<template>
  <div class="company-user-list" v-show="isShow">
    <div class="project_msg" v-if="projectShowMsg">
      <div class="project_msg_show">
        <el-descriptions title="项目信息">
          <el-descriptions-item label="客户公司名称">{{
            projectShowMsg.projectName
            }}</el-descriptions-item>
          <el-descriptions-item label="项目">{{
            projectShowMsg.brands
            }}</el-descriptions-item>
          <el-descriptions-item label="客户负责人">{{
            projectShowMsg.brandsUsername
            }}</el-descriptions-item>
          <el-descriptions-item label="品类">{{
            projectShowMsg.cates
            }}</el-descriptions-item>
          <el-descriptions-item label="商务">{{
            projectShowMsg.bussinessUsername
            }}</el-descriptions-item>
          <el-descriptions-item label="区域">{{
            projectShowMsg.areas
            }}</el-descriptions-item>
          <el-descriptions-item label="执行负责人">{{
            projectShowMsg.permissionUsername
            }}</el-descriptions-item>
          <el-descriptions-item label="总数量">{{
            projectShowMsg.totalProjectNum
            }}</el-descriptions-item>
          <el-descriptions-item label="总货值">{{
            projectShowMsg.totalProjectPrice
            }}</el-descriptions-item>
          <el-descriptions-item label="创建时间">{{
            projectShowMsg.createDate
            }}</el-descriptions-item>
        </el-descriptions>
      </div>
    </div>
    <ul class="global-operation-list">
      <li class="global-operation-left">
        <ul class="global-filter-list">

          <!-- <li class="global-filter-item" >
              <el-button 
              type="primary"
              class="global-filter-item-search"
              :style="{ backgroundColor: btnStatus == true ? 'red' : 'blue' }"
              @click="searchTimeOut"
              >待处理订单</el-button
            >
          </li> -->
          <li class="global-filter-item">
            <h2 class="global-filter-item-title">关键字：</h2>
            <el-input placeholder="订单号、项目、客户公司名称、客户负责人" v-model="searchForm.keyword" @change="getPost"
              style="width: 300px" clearable></el-input>
          </li>

          <li class="global-filter-item">
            <h2 class="global-filter-item-title">品类：</h2>
            <el-select v-model="searchForm.cateIds" clearable filterable @visible-change="visibleChangeCateIds"
              :loading="searchLoading">
              <el-option v-for="(item, index) in cateList" :key="index" :label="item.sysValueName" :value="item.id">
              </el-option>
            </el-select>
          </li>
          <li class="global-filter-item">
            <h2 class="global-filter-item-title">订单类型：</h2>
            <el-select v-model="searchForm.fileType" clearable filterable :loading="searchLoading">
              <el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </li>
          <li class="global-filter-item">
            <h2 class="global-filter-item-title">订单去向：</h2>
            <el-select v-model="searchForm.orderGo" clearable filterable :loading="searchLoading">
              <el-option v-for="(item, index) in moreOptionsList" :key="index" :label="item.sysValueName"
                :value="item.id">
              </el-option>
            </el-select>
          </li>
          <li class="global-filter-item">
            <h2 class="global-filter-item-title">区域：</h2>
            <el-select v-model="searchForm.areaId" clearable @visible-change="visibleChangeArea"
              :loading="searchLoading">
              <el-option v-for="(item, index) in areaList" :key="index" :label="item.sysValueName" :value="item.id">
              </el-option>
            </el-select>
          </li>
          <li class="global-filter-item"
            v-if="userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)">
            <h2 class="global-filter-item-title">商务：</h2>
            <el-select v-model="searchForm.businessId" clearable filterable @visible-change="visibleChangeBussiness"
              :loading="searchLoading">
              <el-option v-for="(item, index) in bussinessUserList" :key="index" :label="item.sysValueName"
                :value="item.id">
              </el-option>
            </el-select>
          </li>
          <li class="global-filter-item">
            <h2 class="global-filter-item-title">状态：</h2>
            <el-select v-model="searchForm.statusType" clearable :loading="searchLoading">
              <el-option v-for="(item, index) in statusList" :key="index" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </li>
          <li class="global-filter-item">
            <h2 class="global-filter-item-title">订单总计：</h2>
            <el-input v-model="searchForm.startPrice" style="width: 100px" clearable></el-input>
            <div style="padding: 0 5px">——</div>
            <el-input v-model="searchForm.endPrice" style="width: 100px" clearable></el-input>
          </li>

          <li class="global-filter-item">
            <h2 class="global-filter-item-title">倒计时快捷筛选：</h2>
            <el-select v-model="searchForm.pushCheckTimeIndex" clearable filterable :loading="searchLoading">
              <el-option v-for="(item, index) in pushCheckTimeList" :key="index" :label="item.label" :value="index">
              </el-option>
            </el-select>
          </li>
          <li class="global-filter-item">
            <h2 class="global-filter-item-title">倒计时：</h2>
            <el-input v-model="searchForm.pushSureCheckStartTime" style="width: 150px" clearable>
              <template slot="append">小时</template>
            </el-input>
            <div style="padding: 0 2px">—</div>
            <el-input v-model="searchForm.pushSureCheckEndTime" style="width: 150px" clearable>
              <template slot="append">小时</template>
            </el-input>
          </li>

          <li class="global-filter-item">
            <h2 class="global-filter-item-title">已拆单：</h2>
            <el-checkbox v-model="searchForm.showSubOrderType"></el-checkbox>
          </li>

          <li class="global-filter-item">
            <el-button type="primary" class="global-filter-item-search" @click="rePosts">搜索</el-button>
          </li>
          <li class="global-filter-item">
            <el-button type="primary" class="global-filter-item-search" v-if="operationList.includes('add')"
              @click="add">添加</el-button>
          </li>
        </ul>
      </li>
    </ul>
    <div class="global-table-content">
      <div class="global-table-content-a">
        <!-- <div>
                    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelectMenu">
                        <el-menu-item index="10">全部</el-menu-item>
                        <el-menu-item index="1">待处理</el-menu-item>
                        <el-menu-item index="2">进行中</el-menu-item>
                        <el-menu-item index="7">已完成</el-menu-item>
                        <el-menu-item index="8">已拒绝</el-menu-item>
                        <el-menu-item index="9">已作废</el-menu-item>
                    </el-menu>
                </div> -->
        <el-table :data="dataList" style="width: 100%" :row-style="{ height: '0' }" :cell-style="{ padding: '3px' }"
          max-height="620" border row-key="id" default-expand-all :tree-props="{children: 'childOrderList'}">
          v-loading="tableLoading"
          >
          <el-table-column fixed="left" prop="createTime" label="创建时间"
            :formatter="(row) => formatterTime(row.createTime)" width="200">
            <template slot-scope="scope">
              <el-button type="text" @click="goViewMsg(scope.row)">{{ formatterTime(scope.row.createTime) }}</el-button>
            </template>
          </el-table-column>
          <el-table-column fixed="left" prop="checkTime" label="签单时间" :formatter="(row) => formatterTime(row.checkTime)"
            width="160">
          </el-table-column>
          <el-table-column fixed="left" prop="checkTime" label="确认核价时间"
            :formatter="(row) => formatterTime(row.pushSureCheckTime)" width="160">
          </el-table-column>
          <el-table-column prop="rate" width="50px" label="评级" show-overflow-tooltip>
            <template slot-scope="scope">
              <div v-if="scope.row.rate">
                <el-tooltip class="item" effect="dark" :content="scope.row.rateContent" placement="top-start">
                  <el-popover placement="right" width="800" trigger="click">
                    <div>
                      <el-table :data="rateRecordList" style="width: 100%" height="300">
                        <el-table-column prop="date" label="日期" show-overflow-tooltip
                          :formatter="(rateRecordRow) => formatterTime(rateRecordRow.createTime)">
                        </el-table-column>
                        <el-table-column prop="username" label="姓名" show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column prop="rate" label="评级等级" show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column prop="userType" label="用户类型" show-overflow-tooltip>
                          <template slot-scope="scope">
                            {{ scope.row.userType == 1 ? "小程序用户" : "pc用户"}}
                          </template>
                        </el-table-column>
                      </el-table>
                    </div>
                    <el-button slot="reference" type="text"
                      @click="showRecordList(scope.row.id)">{{scope.row.rate}}</el-button>
                  </el-popover>
                </el-tooltip>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="pushSureCheckDate" width="100px" label="倒计时" show-overflow-tooltip
            :formatter="(row) => formatterTime2(row.pushSureCheckDate)">
          </el-table-column>
          <el-table-column prop="orderKey" width="100px" label="订单号" show-overflow-tooltip>
          </el-table-column>
          <el-table-column prop="fileType" width="100px" label="订单类型" show-overflow-tooltip>
            <template slot-scope="scope">
              <div>
                {{
                scope.row.fileType == 1
                ? "核价订单"
                : scope.row.fileType == 2
                ? "本地生活"
                : scope.row.fileType == 3
                ? "酒店民宿"
                : "--"
                }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="orderGo" width="100px" label="订单去向" show-overflow-tooltip
            :formatter="(row) => formatterOrderType(row.orderGo)">

          </el-table-column>
          <el-table-column prop="expectPrice" width="100px" label="预计变现" show-overflow-tooltip>
            <template slot-scope="scope">
              <div>
                {{
                scope.row.expectPrice == null
                ? "--"
                : scope.row.expectPrice
                }}
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="status" width="100px" label="状态" show-overflow-tooltip>
            <template slot-scope="scope">
              <div>
                {{
                scope.row.projectMsg.status == 9
                ? "已黄单"
                : scope.row.status == 1
                ? "待推送"
                : scope.row.status == 2
                ? "核价中"
                : scope.row.status == 3
                ? "跟进中"
                : scope.row.status == 4
                ? "已签单"
                : scope.row.status == 5
                ? "已签单"
                : scope.row.status == 7
                ? scope.row.projectMsg.checkTime
                ? "执行完"
                : "已签单"
                : scope.row.status == 8
                ? ("已拒绝" + "。理由：" + scope.row.refuseReason)
                : scope.row.status == 9
                ? "已作废"
                : scope.row.status == 11
                ? "已流单"
                : "--"
                }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="projectMsg" width="200px" label="项目详情" show-overflow-tooltip>
            <template slot-scope="scope">
              <div :style="
                  !scope.row.showProjectMore
                    ? 'display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis'
                    : ''
                ">
                项目：{{ scope.row.projectMsg.brands }}
              </div>
              <div :style="!scope.row.showProjectMore ? 'display: none;' : ''">
                客户公司名称：{{ scope.row.projectMsg.projectName }}
              </div>
              <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                客户负责人：{{ scope.row.projectMsg.brandsUsername }}
              </div>
              <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                品类：{{ scope.row.projectMsg.cates }}
              </div>
              <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                区域：{{ scope.row.projectMsg.areas }}
              </div>
              <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                执行负责人：{{ scope.row.projectMsg.permissionUsername }}
              </div>
              <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                商务：{{ scope.row.projectMsg.bussinessUsername }}
              </div>
              <el-button type="text" style="padding: 0px"
                @click="scope.row.showProjectMore = !scope.row.showProjectMore">{{
                scope.row.showProjectMore ? "缩略" : "查看更多"
                }}</el-button>
            </template>
          </el-table-column>
          <el-table-column prop="totalPrice" label="订单总计" width="150" show-overflow-tooltip>
          </el-table-column>
          <el-table-column prop="totalNum" label="订单总数量" width="100" show-overflow-tooltip>
          </el-table-column>
          <el-table-column prop="innerPrice" label="内部货值" width="100" show-overflow-tooltip>
          </el-table-column>
          <!-- <el-table-column prop="isPush" label="推送状态">
                        <template slot-scope="scope">
                            <div>{{ 
                                scope.row.isPush == 1 ? '待推送' : 
                                scope.row.isPush == 2 ? '已推送' : '--' }}</div>
                        </template>
                    </el-table-column> -->
          <el-table-column prop="pushUserName" label="推送详情" width="200" show-overflow-tooltip>
            <template slot-scope="scope">
              <el-popover placement="top-start" width="300" trigger="click">
                <el-descriptions title="推送详情" :column="1">
                  <el-descriptions-item label="推送开拓者">{{
                    scope.row.pushUserName
                    }}</el-descriptions-item>
                  <el-descriptions-item label="推送助理">{{
                    scope.row.pushAssistantName
                    }}</el-descriptions-item>
                </el-descriptions>
                <el-descriptions title="转推详情" :column="1" v-if="scope.row.isNextPush == 2">
                  <el-descriptions-item label="转推开拓者">
                    <div v-for="(item, index) in scope.row.nextPushUserNames" :key="index">
                      {{ item }}
                    </div>
                  </el-descriptions-item>
                  <el-descriptions-item label="转推助理">
                    <div v-for="(item, index) in scope.row.nextPushAssistantNames" :key="index">
                      {{ item }}
                    </div>
                  </el-descriptions-item>
                </el-descriptions>
                <el-button slot="reference" type="text">
                  <div style="display: inline-flex;">
                    <div>{{ scope.row.pushUserName }}</div>
                    <div v-if="scope.row.isNextPush == 2" style="padding-left: 5px;display: inline-flex;">
                      转推对象：
                      <div v-for="(item, index) in scope.row.nextPushUserNames" :key="index">
                        {{ item }}
                      </div>
                    </div>
                  </div>
                </el-button>
              </el-popover>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="pushUserName" label="推送" width="150" show-overflow-tooltip>
                        <template slot-scope="scope">
                            <div style="display: inline-flex;">
                                <div>{{ 
                                    scope.row.pushUserName
                                }}</div>
                                <div v-if="scope.row.isNextPush == 2" style="padding-left: 5px;display: inline-flex;">
                                    转推对象：
                                    <div v-for="(item, index) in scope.row.nextPushUserNames" :key="index">
                                        {{
                                            item
                                        }}
                                    </div>
                                </div>
                            </div>
                        </template>
                    </el-table-column> -->
          <el-table-column fixed="right" label="操作" width="100">
            <template slot-scope="scope">
              <el-dropdown trigger="click" @command="handleCommand($event, scope.row)" @visible-change="showOptions">
                <span class="el-dropdown-link" :style="{
                    color: $store.state.theme.theme_color || '#03C192',
                    cursor: 'pointer',
                  }">
                  操作
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item command="a">查看详情</el-dropdown-item>
                  <el-dropdown-item command="changeResourcesRemark"
                    v-if="(scope.row.resourcesRemark || scope.row.isPush == 2) && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))">修改资源要求</el-dropdown-item>
                  <el-dropdown-item command="b" v-if="
                      operationList.includes('push') && scope.row.isPush == 1
                    ">推送</el-dropdown-item>
                  <el-dropdown-item command="c" v-if="
                      operationList.includes('rePush') &&
                        scope.row.isPush == 2 &&
                        scope.row.status == 3 &&
                        (!scope.row.isBackPush || scope.row.isBackPush == 1)
                    ">重新推送</el-dropdown-item>
                  <el-dropdown-item command="skipBidding" v-if="
                      operationList.includes('skipBidding') && scope.row.status == 4
                    ">跳过竞价</el-dropdown-item>
                  <el-dropdown-item command="setRate" v-if="operationList.includes('setRate')">评级</el-dropdown-item>
                  <el-dropdown-item command="editCost"
                    v-if="operationList.includes('editCost') && scope.row.isHasChild == 1">填写数据</el-dropdown-item>
                  <el-dropdown-item command="editCostSubOrder"
                    v-if="operationList.includes('editCost') && scope.row.isHasChild == 2">分配子订单数据</el-dropdown-item>
                  <!-- <el-dropdown-item command="splitOrder" v-if="
                      operationList.includes('splitOrder') &&
                      scope.row.isHasChild === 1 &&
                      scope.row.checkTime != null &&
                      scope.row.status < 5 &&
                      scope.row.parentId == null
                      ">拆单
                  </el-dropdown-item> -->
                  <el-dropdown-item command="splitOrderNew" v-if="
                      operationList.includes('splitOrder') &&
                      scope.row.isHasChild === 1 &&
                      scope.row.checkTime != null &&
                      // scope.row.status < 5 &&
                      scope.row.parentId == null
                      ">拆单
                  </el-dropdown-item>
                  <el-dropdown-item command="e" v-if="
                      operationList.includes('cancel') && scope.row.status != 9
                    ">作废</el-dropdown-item>
                  <el-dropdown-item command="f" v-if="operationList.includes('del')">删除</el-dropdown-item>
                  <el-dropdown-item command="delChild" v-if="
                      operationList.includes('deleteChildOrder') &&
                      scope.row.isHasChild === 2 
                      ">删除子订单</el-dropdown-item>
                  <el-dropdown-item command="addTimeOutRemark"
                    v-if="operationList.includes('addTimeOutRemark') && scope.row.isTimeOut == 2 ">填写超时说明</el-dropdown-item>
                  <el-dropdown-item command="more" v-if="
                      operationList.includes('confirmOrderUse') &&
                      scope.row.isHasChild == 1 &&
                      scope.row.checkTime != null &&
                      scope.row.status < 5 && 
                      scope.row.parentId == null
                    ">
                    <el-dropdown @command="val => moreOptionsChange(val, scope.row)">
                      <span class="el-dropdown-link">
                        更多操作
                      </span>
                      <el-dropdown-menu slot="dropdown">
                        <div v-for="(item, index) in moreOptionsList.filter(item => item.id !== 155)" :key="index">
                          <el-dropdown-item :command="item.id">{{ item.sysValueName }}</el-dropdown-item>
                        </div>
                      </el-dropdown-menu>
                    </el-dropdown>
                  </el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </template>
          </el-table-column>
        </el-table>
        <div class="global-page">
          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-sizes="pageSizes"
            :page-size="pageSize" :current-page="pageNum" background layout="sizes, total, prev, pager, next"
            :total="total">
          </el-pagination>
        </div>
      </div>
    </div>

    <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
      <el-form :model="form" :rules="rules" ref="ruleForm">
        <el-form-item label="客户公司名称" prop="projectName" :label-width="formLabelWidth">
          <el-input v-model="form.projectName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="项目名称" prop="brands" :label-width="formLabelWidth">
          <el-input v-model="form.brands" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="品类" prop="cateIdList" :label-width="formLabelWidth">
          <el-select v-model="form.cateIdList" placeholder="请选择" multiple>
            <el-option v-for="(item, index) in cateList" :key="index" :label="item.sysValueName"
              :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="商务" prop="bussinessUsername" :label-width="formLabelWidth">
          <el-input v-model="form.bussinessUsername" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="区域" prop="areaIds" :label-width="formLabelWidth">
          <el-select v-model="form.areaIds" placeholder="请选择" multiple>
            <el-option v-for="(item, index) in areaList" :key="index" :label="item.sysValueName"
              :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="执行负责人" prop="permissionUsername" :label-width="formLabelWidth">
          <el-input v-model="form.permissionUsername" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="submit">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 推送核价通知 -->
    <el-dialog :title="pushUserDialogTitle" :visible.sync="pushUserDialogVisible">
      <div style="display: flex;width: 100%;">
        <div style="align-items: center;display: flex;">资源要求：</div>
        <div style="width: 50%;">
          <el-input type="textarea" disabled v-model="resourcesRemark" :rows="2" placeholder="请输入"></el-input>
        </div>
      </div>
      <div style="display: flex; gap: 50px;">
        <el-table ref="pushTable" :data="pushUserList" tooltip-effect="dark" style="width: 40%"
          :row-style="{ height: '0' }" :cell-style="{ padding: '3px' }" max-height="500"
          @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="20"> </el-table-column>
          <el-table-column prop="nickName" label="开拓者昵称" width="150">
          </el-table-column>
          <el-table-column prop="telephone" label="电话" show-overflow-tooltip>
          </el-table-column>
        </el-table>
        <!-- //助理 -->
        <el-table ref="singleTable" :data="pushAssitantList" tooltip-effect="dark" style="width: 40%"
          :row-style="{ height: '0' }" :cell-style="{ padding: '3px' }" max-height="500"
          @selection-change="handleSelectionChangeAssistant">
          <el-table-column type="selection" width="20"> </el-table-column>
          <el-table-column prop="nickName" label="助理昵称" width="150">
          </el-table-column>
          <el-table-column prop="telephone" label="电话" show-overflow-tooltip>
          </el-table-column>
        </el-table>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="pushUserDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitPush">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 推送资源需求 -->
    <el-dialog title="资源需求" :visible.sync="resourcesRemarkDialogVisible">
      <div style="display: flex;width: 100%;">
        <div style="align-items: center;display: flex;">资源要求：</div>
        <div style="width: 50%;">
          <el-input type="textarea" v-model="resourcesRemark" :rows="2" placeholder="请输入"></el-input>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="resourcesRemarkDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitResourcesRemark">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 重新推送核价通知 -->
    <el-dialog :title="rePushUserDialogTitle" :visible.sync="rePushUserDialogVisible">
      <div>
        <el-table ref="pushTable" :data="pushUserList" tooltip-effect="dark" :row-style="{ height: '0' }"
          :cell-style="{ padding: '3px' }" max-height="500" style="width: 100%"
          @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column prop="nickName" label="昵称" width="120">
          </el-table-column>
          <el-table-column prop="telephone" label="电话" show-overflow-tooltip>
          </el-table-column>
        </el-table>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="rePushUserDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitRePush">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="订单详情" :visible.sync="orderMsgDialogVisible" width="80%">
      <div>
        <!-- 订单信息详情 -->
        <div class="order_msg">
          <div>
            <el-descriptions title="订单信息">
              <el-descriptions-item label="订单号">{{
                orderShowMsg.orderKey
                }}</el-descriptions-item>
              <el-descriptions-item label="总数量">{{
                orderShowMsg.totalNum
                }}</el-descriptions-item>
              <el-descriptions-item label="客户总货值">{{
                orderShowMsg.totalPrice
                }}</el-descriptions-item>
              <el-descriptions-item label="实际总货值">{{
                orderShowMsg.orderFinalTotalPrice
                }}</el-descriptions-item>
              <el-descriptions-item label="创建时间">{{
                orderShowMsg.createDate
                }}</el-descriptions-item>
              <el-descriptions-item label="状态">{{
                orderShowMsg.status == 1
                ? "待推送"
                : orderShowMsg.status == 2
                ? "核价中"
                : orderShowMsg.status == 3
                ? "核价等待中"
                : orderShowMsg.status == 4
                ? "一次竞价中"
                : orderShowMsg.status == 5
                ? "二次竞价中"
                : orderShowMsg.status == 6
                ? "待签署电子协议"
                : orderShowMsg.status == 7
                ? "已完成"
                : orderShowMsg.status == 9
                ? "已作废"
                : "--"
                }}
              </el-descriptions-item>
              <el-descriptions-item label="是否已推送给开拓者">{{
                orderShowMsg.isPush && orderShowMsg.isPush == 2
                ? "已推送"
                : "待推送"
                }}</el-descriptions-item>
              <el-descriptions-item label="是否进行转推">{{
                orderShowMsg.isNextPush && orderShowMsg.isNextPush == 2
                ? "是"
                : "否"
                }}</el-descriptions-item>
              <el-descriptions-item label="转推对象人员" v-if="orderShowMsg.isNextPush && orderShowMsg.isNextPush == 2">
                <div v-for="(item, index) in orderShowMsg.nextPushUserNames" :key="index">
                  {{ item }}；
                </div>
              </el-descriptions-item>
              <el-descriptions-item label="预估成本"
                v-if="userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)">{{
                orderShowMsg.estimatedCost
                }}</el-descriptions-item>
              <el-descriptions-item label="实际成本"
                v-if="userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)">{{
                orderShowMsg.actualCost
                }}</el-descriptions-item>
              <el-descriptions-item label="签单时间">{{
                orderShowMsg.checkTime ? orderShowMsg.checkTime : "无"
                }}</el-descriptions-item>
              <el-descriptions-item label="资源要求"
                v-if="orderShowMsg.resourcesRemark && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))">{{
                orderShowMsg.resourcesRemark }}</el-descriptions-item>
              <el-descriptions-item label="折扣"
                v-if="orderShowMsg.isDiscount && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))">{{
                orderShowMsg.isDiscount == 1 ? "折扣" : "固定金额"
                }}</el-descriptions-item>
              <el-descriptions-item label="折扣优惠"
                v-if="orderShowMsg.isDiscount && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))">{{
                orderShowMsg.isDiscount == 1
                ? orderShowMsg.discountPrice + "折"
                : orderShowMsg.discountPrice
                }}</el-descriptions-item>
              <el-descriptions-item label="参考价格 "
                v-if="userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)">{{
                orderShowMsg.referencePrice
                }}</el-descriptions-item>
            </el-descriptions>
            <div v-if="orderShowMsg.childOrderList && orderShowMsg.childOrderList.length > 0">
              <el-divider></el-divider>
              <el-descriptions title="子订单信息">
              </el-descriptions>
              <el-table :data="orderShowMsg.childOrderList" style="width: 100%" :row-style="{ height: '0' }"
                :cell-style="{ padding: '3px' }" max-height="300" border>
                v-loading="tableLoading"
                >
                <el-table-column fixed="left" prop="createTime" label="创建时间"
                  :formatter="(row) => formatterTime(row.createTime)" width="200">
                </el-table-column>
                <el-table-column fixed="left" prop="checkTime" label="签单时间"
                  :formatter="(row) => formatterTime(row.checkTime)" width="160">
                </el-table-column>
                <el-table-column prop="orderKey" width="100px" label="订单号" show-overflow-tooltip>
                </el-table-column>
                <el-table-column prop="fileType" width="100px" label="订单类型" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <div>
                      {{
                      scope.row.fileType == 1
                      ? "核价订单"
                      : scope.row.fileType == 2
                      ? "本地生活"
                      : scope.row.fileType == 3
                      ? "酒店民宿"
                      : "--"
                      }}
                    </div>
                  </template>
                </el-table-column>
                <el-table-column prop="status" width="100px" label="状态" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <div>
                      {{
                      scope.row.projectMsg.status == 9
                      ? "已黄单"
                      : scope.row.status == 1
                      ? "待推送"
                      : scope.row.status == 2
                      ? "核价中"
                      : scope.row.status == 3
                      ? "跟进中"
                      : scope.row.status == 4
                      ? "已签单"
                      : scope.row.status == 5
                      ? "已签单"
                      : scope.row.status == 7
                      ? scope.row.projectMsg.checkTime
                      ? "执行完"
                      : "已签单"
                      : scope.row.status == 8
                      ? "核价中"
                      : scope.row.status == 11
                      ? "已流单"
                      : "--"
                      }}
                    </div>
                  </template>
                </el-table-column>
                <el-table-column prop="projectMsg" width="250px" label="项目详情" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <div :style="
                  !scope.row.showProjectMore
                    ? 'display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis'
                    : ''
                ">
                      项目：{{ scope.row.projectMsg.brands }}
                    </div>
                    <div :style="!scope.row.showProjectMore ? 'display: none;' : ''">
                      客户公司名称：{{ scope.row.projectMsg.projectName }}
                    </div>
                    <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                      客户负责人：{{ scope.row.projectMsg.brandsUsername }}
                    </div>
                    <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                      品类：{{ scope.row.projectMsg.cates }}
                    </div>
                    <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                      区域：{{ scope.row.projectMsg.areas }}
                    </div>
                    <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                      执行负责人：{{ scope.row.projectMsg.permissionUsername }}
                    </div>
                    <div :style="!scope.row.showProjectMore ? 'display: none' : ''">
                      商务：{{ scope.row.projectMsg.bussinessUsername }}
                    </div>
                    <el-button type="text" style="padding: 0" @click="handleShowStatus(scope.row)">{{
                      scope.row.showProjectMore ? "缩略" : "查看更多"
                      }}</el-button>
                  </template>
                </el-table-column>
                <el-table-column prop="totalPrice" label="订单总计" width="150" show-overflow-tooltip>
                </el-table-column>
                <el-table-column prop="totalNum" label="订单总数量" width="100" show-overflow-tooltip>
                </el-table-column>
                <el-table-column prop="innerPrice" label="内部货值" width="100" show-overflow-tooltip>
                </el-table-column>
                <!-- <el-table-column prop="isPush" label="推送状态">
                              <template slot-scope="scope">
                                  <div>{{
                                      scope.row.isPush == 1 ? '待推送' :
                                      scope.row.isPush == 2 ? '已推送' : '--' }}</div>
                              </template>
                          </el-table-column> -->
                <el-table-column prop="pushUserName" label="推送详情" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <el-popover placement="top-start" width="400" trigger="click">
                      <el-descriptions title="推送详情" :column="1">
                        <el-descriptions-item label="推送开拓者">{{
                          scope.row.pushUserName
                          }}</el-descriptions-item>
                        <el-descriptions-item label="推送助理">{{
                          scope.row.pushAssistantName
                          }}</el-descriptions-item>
                      </el-descriptions>
                      <el-descriptions title="转推详情" :column="1" v-if="scope.row.isNextPush == 2">
                        <el-descriptions-item label="转推开拓者">
                          <div v-for="(item, index) in scope.row.nextPushUserNames" :key="index">
                            {{ item }}
                          </div>
                        </el-descriptions-item>
                        <el-descriptions-item label="转推助理">
                          <div v-for="(item, index) in scope.row.nextPushAssistantNames" :key="index">
                            {{ item }}
                          </div>
                        </el-descriptions-item>
                      </el-descriptions>
                      <el-button slot="reference" type="text">
                        <div style="display: inline-flex;">
                          <div>{{ scope.row.pushUserName }}</div>
                          <div v-if="scope.row.isNextPush == 2" style="padding-left: 5px;display: inline-flex;">
                            转推对象：
                            <div v-for="(item, index) in scope.row.nextPushUserNames" :key="index">
                              {{ item }}
                            </div>
                          </div>
                        </div>
                      </el-button>
                    </el-popover>
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <el-divider></el-divider>
            <el-descriptions title="盲盒">
              <el-descriptions-item label="是否进盲盒">{{
                orderShowMsg.isBlindBox && orderShowMsg.isBlindBox == 2
                ? "是"
                : "否"
                }}</el-descriptions-item>
              <el-descriptions-item label="盲盒建议成本"
                v-if="orderShowMsg.isBlindBox && orderShowMsg.isBlindBox == 2 && userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)">{{
                orderShowMsg.blindBoxPrice }}</el-descriptions-item>
              <el-descriptions-item label="盲盒-是否全拿" v-if="orderShowMsg.isBlindBox && orderShowMsg.isBlindBox == 2 ">{{
                orderShowMsg.blindBoxAllTake &&
                orderShowMsg.blindBoxAllTake == 2
                ? "是"
                : "否"
                }}</el-descriptions-item>
            </el-descriptions>
          </div>
        </div>
        <el-divider v-if="
            orderShowMsg.channelUserSecondBiddingListDTOS &&
              orderShowMsg.channelUserSecondBiddingListDTOS.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          "></el-divider>
        <!-- 第二次竞价列表 -->
        <el-descriptions title="第二次竞价列表" v-if="
            orderShowMsg.channelUserSecondBiddingListDTOS &&
orderShowMsg.channelUserSecondBiddingListDTOS.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          "></el-descriptions>
        <div class="good_sku_list" v-if="
            orderShowMsg.channelUserSecondBiddingListDTOS &&
              orderShowMsg.channelUserSecondBiddingListDTOS.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          ">
          <el-table :data="orderShowMsg.channelUserSecondBiddingListDTOS" max-height="300" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" border style="width: 100%;height: auto;">
            <el-table-column prop="pioneerName" label="开拓者姓名">
            </el-table-column>
            <el-table-column prop="channelName" label="渠道姓名">
            </el-table-column>
            <el-table-column prop="totalPrice" label="总价">
            </el-table-column>
            <el-table-column prop="rankNum" label="排名">
            </el-table-column>
            <el-table-column prop="status" label="状态">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.status == 1
                  ? "进行中"
                  : scope.row.status == 2
                  ? "竞价成功"
                  : scope.row.status == 3
                  ? "失去挑战资格"
                  : "--"
                  }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="isAbandon" label="是否放弃">
              <template slot-scope="scope">
                <div>{{ scope.row.isAbandon == 2 ? "已放弃" : "--" }}</div>
              </template>
            </el-table-column>
            <el-table-column prop="createTime" label="时间">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.createTime
                  ? formatterTime(scope.row.createTime)
                  : ""
                  }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-popover placement="right" width="700" trigger="click">
                  <el-table :data="scope.row.goodPriceLists" :row-style="{ height: '0' }"
                    :cell-style="{ padding: '3px' }" border max-height="500">
                    <el-table-column width="200" property="goodName" label="商品名称"></el-table-column>
                    <el-table-column width="200" property="skuName" label="sku"></el-table-column>
                    <el-table-column width="100" property="num" label="数量"></el-table-column>
                    <el-table-column width="150" property="price" label="单价"></el-table-column>
                  </el-table>
                  <el-button slot="reference" type="text" size="small">查看详情</el-button>
                </el-popover>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <el-divider v-if="
            orderShowMsg.channelUserFirstBiddingListDTOS &&
              orderShowMsg.channelUserFirstBiddingListDTOS.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          "></el-divider>
        <!-- 第一次竞价列表 -->
        <el-descriptions title="第一次竞价列表" v-if="
            orderShowMsg.channelUserFirstBiddingListDTOS &&
orderShowMsg.channelUserFirstBiddingListDTOS.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          "></el-descriptions>
        <div class="good_sku_list" v-if="
            orderShowMsg.channelUserFirstBiddingListDTOS &&
              orderShowMsg.channelUserFirstBiddingListDTOS.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          ">
          <div style="font-size: initial; font-weight: bold; color: #dd8e6f">
            第一次竞价截止时间：{{
            orderShowMsg.biddingOneEndTime
            ? formatterTime(orderShowMsg.biddingOneEndTime)
            : "无"
            }}
          </div>
          <el-table :data="orderShowMsg.channelUserFirstBiddingListDTOS" max-height="300" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" border style="width: 100%;height: auto;">
            <el-table-column prop="pioneerName" label="开拓者姓名">
            </el-table-column>
            <el-table-column prop="channelName" label="渠道姓名">
            </el-table-column>
            <el-table-column prop="totalPrice" label="总价">
            </el-table-column>
            <el-table-column prop="rankNum" label="排名">
            </el-table-column>
            <el-table-column prop="status" label="状态">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.status == 1
                  ? "进行中"
                  : scope.row.status == 2
                  ? "竞价成功"
                  : scope.row.status == 3
                  ? "失去挑战资格"
                  : "--"
                  }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="isAbandon" width="180" label="是否放弃">
              <template slot-scope="scope">
                <div>{{ scope.row.isAbandon == 2 ? "已放弃" : "--" }}</div>
              </template>
            </el-table-column>
            <el-table-column prop="createTime" width="180" label="时间">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.createTime
                  ? formatterTime(scope.row.createTime)
                  : ""
                  }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-popover placement="right" width="700" trigger="click">
                  <el-table :data="scope.row.goodPriceLists" :row-style="{ height: '0' }"
                    :cell-style="{ padding: '3px' }" border max-height="500">
                    <el-table-column width="200" property="goodName" label="商品名称"></el-table-column>
                    <el-table-column width="200" property="skuName" label="sku"></el-table-column>
                    <el-table-column width="100" property="num" label="数量"></el-table-column>
                    <el-table-column width="150" property="price" label="单价"></el-table-column>
                  </el-table>
                  <el-button slot="reference" type="text" size="small">查看详情</el-button>
                </el-popover>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <el-divider v-if="
            orderShowMsg.checkCostPrice &&
              orderShowMsg.checkCashPrice &&
              orderShowMsg.checkRemark && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          "></el-divider>

        <!-- 核价开拓者提交信息 -->
        <!-- <el-descriptions title="核价开拓者提交信息" v-if="orderShowMsg.checkCostPrice && orderShowMsg.checkCashPrice && orderShowMsg.checkRemark"></el-descriptions> -->
        <div v-if="
            orderShowMsg.checkCostPrice &&
              orderShowMsg.checkCashPrice &&
orderShowMsg.checkRemark && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          ">
          <el-descriptions title="核价开拓者提交信息" v-if="
              orderShowMsg.checkCostPrice &&
                orderShowMsg.checkCashPrice &&
orderShowMsg.checkRemark && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
            ">
            <el-descriptions-item label="核价-建议成本">{{
              orderShowMsg.checkCostPrice
              }}</el-descriptions-item>
            <el-descriptions-item label="核价-变现价格">{{
              orderShowMsg.checkCashPrice
              }}</el-descriptions-item>
            <el-descriptions-item label="核价-备注">{{
              orderShowMsg.checkRemark
              }}</el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                核价-成本比例&nbsp;
                <el-tooltip class="tooltip" effect="dark" placement="right">
                  <ul slot="content">
                    <li>建议成本/客户货值</li>
                  </ul>
                  <i class="el-icon-question"></i>
                </el-tooltip>
              </template>
              {{ orderShowMsg.checkCostPriceRate }}%
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                核价-变现折扣&ensp;
                <el-tooltip class="tooltip" effect="dark" placement="right">
                  <ul slot="content">
                    <li>变现价格/客户货值</li>
                  </ul>
                  <i class="el-icon-question"></i>
                </el-tooltip>
              </template>
              {{ orderShowMsg.checkCashPriceRate }}%
            </el-descriptions-item>
          </el-descriptions>
          <el-table :data="orderShowMsg.checkMsgList" max-height="300" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" border style="width: 100%;height: auto;">
            <el-table-column prop="nickName" label="开拓者姓名">
            </el-table-column>
            <el-table-column prop="checkCostPrice" label="建议成本">
            </el-table-column>
            <el-table-column prop="checkCashPrice" label="变现价格">
            </el-table-column>
            <el-table-column prop="checkRemark" label="核价备注" width="280">
            </el-table-column>
            <el-table-column prop="createTime" label="提交时间" width="160">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.createTime
                  ? formatterTime(scope.row.createTime)
                  : ""
                  }}
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <el-divider v-if="
            orderShowMsg.channelUserCheckListDTOS &&
              orderShowMsg.channelUserCheckListDTOS.length > 0 && userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)
          "></el-divider>
        <!-- 核价列表 -->
        <el-descriptions title="渠道核价列表" v-if="
            orderShowMsg.channelUserCheckListDTOS &&
orderShowMsg.channelUserCheckListDTOS.length > 0 && userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)
          "></el-descriptions>
        <div class="good_sku_list" v-if="
            orderShowMsg.channelUserCheckListDTOS &&
orderShowMsg.channelUserCheckListDTOS.length > 0 && userInfo.role && !userInfo.role.includes(40) && !userInfo.role.includes(55)
          ">
          <el-table :data="orderShowMsg.channelUserCheckListDTOS" max-height="300" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" border style="width: 100%;height: auto;">
            <el-table-column prop="pioneerName" label="开拓者姓名">
            </el-table-column>
            <el-table-column prop="channelName" label="渠道姓名">
            </el-table-column>
            <el-table-column prop="totalPrice" label="总价">
            </el-table-column>
            <el-table-column prop="createTime" label="时间">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.createTime
                  ? formatterTime(scope.row.createTime)
                  : ""
                  }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-popover placement="right" width="700" trigger="click">
                  <el-table :data="scope.row.goodPriceLists" :row-style="{ height: '0' }"
                    :cell-style="{ padding: '3px' }" border max-height="500">
                    <el-table-column width="200" property="goodName" label="商品名称"></el-table-column>
                    <el-table-column width="200" property="skuName" label="sku"></el-table-column>
                    <el-table-column width="100" property="num" label="数量"></el-table-column>
                    <el-table-column width="150" property="price" label="单价"></el-table-column>
                  </el-table>
                  <el-button slot="reference" type="text" size="small">查看详情</el-button>
                </el-popover>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 助理核价列表 -->
        <el-descriptions title="助理核价列表" v-if="
            orderShowMsg.assistantCheckList &&
              orderShowMsg.assistantCheckList.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
          "></el-descriptions>
        <div class="good_sku_list" v-if="
            orderShowMsg.assistantCheckList &&
    orderShowMsg.assistantCheckList.length > 0 && userInfo.role && (!userInfo.role.includes(40) && !userInfo.role.includes(55))
    ">
          <el-table :data="orderShowMsg.assistantCheckList" max-height="300" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" border style="width: 100%;height: auto;">
            <el-table-column prop="nickName" label="助理姓名" width="180">
            </el-table-column>
            <el-table-column prop="channelName" label="渠道姓名" width="180">
            </el-table-column>
            <el-table-column prop="checkCashPrice" width="180" label="总价">
            </el-table-column>
            <el-table-column prop="createTime" width="180" label="时间">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.createTime
                  ? formatterTime(scope.row.createTime)
                  : ""
                  }}
                </div>
              </template>
            </el-table-column>

          </el-table>
        </div>
        <el-divider></el-divider>
        <!-- 商品列表 -->
        <el-descriptions title="商品列表"></el-descriptions>
        <div>
          <el-button type="text" v-if="operationList.includes('submitFlagshipStoreData')"
            @click="showUpdateGoodsDialog">修改商品数据</el-button>
        </div>
        <div class="good_sku_list" v-if="
            orderShowMsg.goodList &&
              orderShowMsg.goodList.length > 0 &&
              orderShowMsg.fileType == 1 || orderShowMsg.fileType == 4
          ">
          <el-table :data="orderShowMsg.goodList" height="350" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" style="width: 100%">
            <el-table-column prop="brandsValue" label="品牌" width="180">
            </el-table-column>
            <el-table-column prop="goodName" label="商品名称" width="180">
            </el-table-column>
            <el-table-column prop="goodExpirationDate" width="180" label="有效期至" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodWarrantyDate" width="180" label="保质期" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodSku" label="规格" width="180" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodSkuNum" width="150" label="数量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodSkuPrice" width="180" label="旗舰店售卖价" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodCategory" width="180" label="商品所属类别（例:妆字号、械字号、消字号、药字号等）" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodOnlineLink" width="180" show-overflow-tooltip label="天猫/京东链接">
              <template slot-scope="scope">
                <el-link :href="scope.row.goodOnlineLink" type="primary" target="_blank"
                  v-if="scope.row.goodOnlineLink">跳转</el-link>
              </template>
            </el-table-column>
            <el-table-column prop="goodSkuPic" width="150" label="图片" show-overflow-tooltip>
              <template slot-scope="scope">
                <el-image v-if="scope.row.goodSkuPic" style="width: 100px; height: 100px" :src="scope.row.goodSkuPic"
                  :preview-src-list="[scope.row.goodSkuPic]">
                </el-image>
              </template>
            </el-table-column>
            <el-table-column prop="goodBoxNum" width="180" label="箱规（数量）" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodBoxSize" width="180" label="箱规（尺寸mm）" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodOneSize" width="180" label="单个产品包装尺寸mm" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="shopFans" width="180" label="店铺粉丝量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodSaleNum" width="180" label="产品销量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="finalPrice" width="180" label="实际成交价">
            </el-table-column>
            <el-table-column prop="finalTotalPrice" width="180" label="实际成交总价">
            </el-table-column>
            <el-table-column prop="flagshipStorePrice" width="180" label="旗舰店价格" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="flagshipStoreFans" width="180" label="旗舰店粉丝量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="salesNum" width="180" label="销量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="evaluateContent" width="180" label="评价" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="lowestPrice" width="180" label="最低价" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="link" width="180" label="链接" show-overflow-tooltip>
            </el-table-column>
          </el-table>
        </div>
        <div class="good_sku_list" v-if="
            orderShowMsg.goodList &&
              orderShowMsg.goodList.length > 0 &&
              orderShowMsg.fileType == 2
          ">
          <el-table :data="orderShowMsg.goodList" max-height="750" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" style="width: 100%">
            <el-table-column prop="chainStoreName" fixed label="连锁店铺名称">
            </el-table-column>
            <el-table-column prop="category" fixed label="类别">
            </el-table-column>
            <el-table-column prop="storeNumber" label="店铺数量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="links" label="美团/大众点评/小程序店铺链接">
              <template slot-scope="scope">
                <el-link :href="scope.row.links" type="primary" target="_blank" v-if="scope.row.links">跳转</el-link>
              </template>
            </el-table-column>
            <el-table-column prop="averageScore" label="美团/大众点评店铺平均评分" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="validityPeriod" label="有效期" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="useTime" label="使用时间" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="distributedCities" label="可使用分布城市" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="productName" label="产品名称" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="packageDetails" label="套餐详细内容" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="price" label="单价"></el-table-column>
            <el-table-column prop="num" label="数量"></el-table-column>
            <el-table-column prop="totalGoodPrice" label="合计货值" show-overflow-tooltip></el-table-column>
            <el-table-column prop="useRights" label="使用权益" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="couponForm" label="卡券形式（电子/实体）" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="usageRestrictions" label="使用限制" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="sellRequirements" label="客户对我司售卖要求" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="storeLinks" label="产品/套餐链接（美团、大众点评等）" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="storePics" label="产品/套餐图片" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="storeSaleNumbers" label="产品/套餐销量（美团、大众点评）" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="verificationProcess" label="核销流程" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="finalPrice" label="实际成交价">
            </el-table-column>
            <el-table-column prop="finalTotalPrice" width="180" label="实际成交总价">
            </el-table-column>
            <el-table-column prop="flagshipStorePrice" width="180" label="旗舰店价格" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="flagshipStoreFans" width="180" label="旗舰店粉丝量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="salesNum" width="180" label="销量" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="evaluateContent" width="180" label="评价" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="lowestPrice" width="180" label="最低价" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="link" width="180" label="链接" show-overflow-tooltip>
            </el-table-column>
          </el-table>
        </div>
        <div class="good_sku_list" v-if="
            orderShowMsg.goodList &&
              orderShowMsg.goodList.length > 0 &&
              orderShowMsg.fileType == 3
          ">
          <div class="form_table_goods">
            <el-table :data="orderShowMsg.goodList" max-height="750" :row-style="{ height: '0' }"
              :cell-style="{ padding: '3px' }" style="width: 100%">
              <el-table-column prop="hotelName" fixed label="酒店名称">
              </el-table-column>
              <el-table-column prop="hotelAddress" fixed label="酒店地址">
              </el-table-column>
              <el-table-column prop="busyTime" label="旺季时间">
              </el-table-column>
              <el-table-column prop="hotelType" label="房型"> </el-table-column>
              <el-table-column prop="expirationDate" label="有效期">
              </el-table-column>
              <el-table-column prop="isHaveMorning" label="是否含早"></el-table-column>
              <el-table-column prop="num" label="数量"></el-table-column>
              <el-table-column prop="price" label="平台价"> </el-table-column>
              <el-table-column prop="url" show-overflow-tooltip label="链接">
              </el-table-column>
              <el-table-column prop="hotelPic" label="房间图片">
                <template slot-scope="scope">
                  <el-image v-if="scope.row.hotelPic" style="width: 100px; height: 100px" :src="scope.row.hotelPic"
                    :preview-src-list="[scope.row.hotelPic]">
                  </el-image>
                </template>
              </el-table-column>
              <el-table-column prop="realPrice" width="180" label="实际成交价">
              </el-table-column>
              <el-table-column prop="finalTotalPrice" width="180" label="实际成交总价">
              </el-table-column>
              <el-table-column prop="flagshipStorePrice" width="180" label="旗舰店价格" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="flagshipStoreFans" width="180" label="旗舰店粉丝量" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="salesNum" width="180" label="销量" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="evaluateContent" width="180" label="评价" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="lowestPrice" width="180" label="最低价" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="link" width="180" label="链接" show-overflow-tooltip>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <el-divider v-if="
        orderShowMsg.businessRemark &&
          orderShowMsg.businessRemark.length > 0 
      "></el-divider>
        <!-- 商务超时说明 -->
        <el-descriptions title="商务超时未签单说明" v-if="
          orderShowMsg.businessRemark &&
            orderShowMsg.businessRemark.length > 0 
        "></el-descriptions>
        <div class="good_sku_list" v-if="
          orderShowMsg.businessRemark &&
            orderShowMsg.businessRemark.length > 0 
        ">
          <el-table :data="orderShowMsg.businessRemark" max-height="300" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" border style="width: 100%;height: auto;">
            <el-table-column prop="businessName" label="商务姓名" width="100">
            </el-table-column>
            <el-table-column prop="content" label="说明内容" width="700">
            </el-table-column>

            <el-table-column prop="createTime" width="175" label="时间">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.createTime
                  ? formatterTime(scope.row.createTime)
                  : ""
                  }}
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>

        <el-divider v-if="
        orderShowMsg.businessRemarkReply &&
          orderShowMsg.businessRemarkReply.length > 0 
      "></el-divider>
        <!-- 开拓者回复超时反馈 -->
        <el-descriptions title="开拓者回复超时反馈" v-if="
          orderShowMsg.businessRemarkReply &&
            orderShowMsg.businessRemarkReply.length > 0 
        "></el-descriptions>
        <div class="good_sku_list" v-if="
          orderShowMsg.businessRemarkReply &&
            orderShowMsg.businessRemarkReply.length > 0 
        ">
          <el-table :data="orderShowMsg.businessRemarkReply" max-height="300" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" border style="width: 100%;height: auto;">
            <el-table-column prop="pioneerName" label="开拓者姓名" width="100">
            </el-table-column>
            <el-table-column prop="content" label="说明内容" width="700">
            </el-table-column>

            <el-table-column prop="createTime" width="175" label="时间">
              <template slot-scope="scope">
                <div>
                  {{
                  scope.row.createTime
                  ? formatterTime(scope.row.createTime)
                  : ""
                  }}
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <el-divider></el-divider>
        <!-- 项目信息 -->
        <div class="">
          <el-descriptions title="项目信息">
            <el-descriptions-item label="客户公司名称">{{
              orderShowMsg.projectMsg.projectName
              }}</el-descriptions-item>
            <el-descriptions-item label="项目">{{
              orderShowMsg.projectMsg.brands
              }}</el-descriptions-item>
            <el-descriptions-item label="客户负责人">{{
              orderShowMsg.projectMsg.brandsUsername
              }}</el-descriptions-item>
            <el-descriptions-item label="品类">{{
              orderShowMsg.projectMsg.cates
              }}</el-descriptions-item>
            <el-descriptions-item label="商务">{{
              orderShowMsg.projectMsg.bussinessUsername
              }}</el-descriptions-item>
            <el-descriptions-item label="区域">{{
              orderShowMsg.projectMsg.areas
              }}</el-descriptions-item>
            <el-descriptions-item label="执行负责人">{{
              orderShowMsg.projectMsg.permissionUsername
              }}</el-descriptions-item>
            <el-descriptions-item label="总数量">{{
              orderShowMsg.projectMsg.totalProjectNum
              }}</el-descriptions-item>
            <el-descriptions-item label="客户总货值">{{
              orderShowMsg.projectMsg.totalProjectPrice
              }}</el-descriptions-item>
            <el-descriptions-item label="实际总货值">{{
              orderShowMsg.projectFinalTotalPrice
              }}</el-descriptions-item>
            <el-descriptions-item label="创建时间">{{
              orderShowMsg.projectMsg.createDate
              }}</el-descriptions-item>
          </el-descriptions>
        </div>
      </div>
    </el-dialog>

    <!-- 调整订单 -->
    <el-dialog title="调整订单" :visible.sync="adjustOrderDialogVisible" width="80%">
      <div class="adjustOrderItem">
        <div class="adjustOrderItem_left">调整类型</div>
        <div class="adjustOrderItem_right">
          <el-radio-group v-model="adjustOrderType" disabled>
            <el-radio :label="1">竞价</el-radio>
            <el-radio :label="2">盲盒</el-radio>
          </el-radio-group>
        </div>
      </div>
      <div class="adjustOrderItem" v-if="adjustOrderType == 1">
        <div class="adjustOrderItem_left">渠道商</div>
        <div class="adjustOrderItem_right">
          <el-select v-model="adjustOrderUserId" placeholder="请选择">
            <el-option v-for="item in adjustUserList" :key="item.id" :label="item.nickName" :value="item.id">
            </el-option>
          </el-select>
        </div>
      </div>
      <div class="adjustOrderItem">
        <div class="adjustOrderItem_left">商品列表</div>
        <div class="adjustOrderItem_right">
          <el-table ref="singleTable" :data="orderGoodList" tooltip-effect="dark" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" style="width: 100%" max-height="500"
            @selection-change="handleSelectionChangeAdjustOrder">
            <el-table-column type="selection" fixed width="55">
            </el-table-column>
            <el-table-column prop="goodName" label="商品名称" width="150">
            </el-table-column>
            <el-table-column prop="goodSkuName" label="规格" width="120">
            </el-table-column>
            <el-table-column prop="goodNum" label="数量" width="200">
              <template slot-scope="scope">
                <div>
                  <el-input-number v-model="scope.row.goodNum" :precision="0" :min="0" :max="scope.row.maxNum"
                    label="商品数量"></el-input-number>
                </div>
                <div style="color: #c9c5c5">
                  最大数量：{{ scope.row.maxNum }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="goodPrice" label="单价" width="200">
              <template slot-scope="scope">
                <div>
                  <el-input-number v-model="scope.row.goodPrice" :precision="2" :min="0" label="单价"></el-input-number>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="adjustOrderDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitAdjustOrder">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 填写订单超时说明 -->

    <el-dialog title="订单超时说明" :visible.sync="addTimeOutRemarkDialog">

      <div>
        <el-input type="textarea" placeholder="请输入50字以上说明" v-model="timeOutContent" minlength="50" show-word-limit>
        </el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="addTimeOutRemarkDialog = false">取 消</el-button>
        <el-button type="primary" @click="addTimeOutRemark">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 修改订单成本 -->
    <el-dialog title="修改订单成本" :visible.sync="editCostDialogVisible" width="60%">
      <div class="adjustOrderItem">
        <div class="adjustOrderItem_left">预估成本</div>
        <div class="adjustOrderItem_right">
          <el-input-number v-model="estimatedCost" :precision="2" :min="0" label="预估成本"></el-input-number>
        </div>
      </div>
      <div class="adjustOrderItem">
        <div class="adjustOrderItem_left">实际成本</div>
        <div class="adjustOrderItem_right">
          <el-input-number v-model="actualCost" :precision="2" :min="0" label="实际成本"></el-input-number>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="editCostDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitCostOrder">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 拆单 -->
    <el-dialog title="拆单" :visible.sync="splitOrderDialog" width="60%" @close="splitOrderDialogClose">
      <div>
        <div style="margin-bottom: 20px;">
          <el-steps :active="active">
            <el-step title="选择商品"></el-step>
            <el-step title="商品拆单"></el-step>
            <el-step title="订单去向"></el-step>
          </el-steps>
        </div>
        <div v-show="active === 1">
          <el-table :data="orderShowMsg.goodList" height="450" :row-style="{ height: '0' }"
            :cell-style="{ padding: '3px' }" style="width: 100%" @selection-change="handleSelectGoods">
            <el-table-column type="selection" width="55">
            </el-table-column>
            <el-table-column prop="goodName" label="商品名称" width="180">
            </el-table-column>
            <el-table-column prop="goodSku" label="规格" width="180">
            </el-table-column>
            <el-table-column prop="goodSkuNum" width="150" label="数量">
            </el-table-column>
            <el-table-column prop="goodSkuPrice" width="180" label="价格">
            </el-table-column>
            <el-table-column prop="goodSkuPic" width="150" label="图片">
              <template slot-scope="scope">
                <el-image v-if="scope.row.goodSkuPic" style="width: 100px; height: 100px" :src="scope.row.goodSkuPic"
                  :preview-src-list="[scope.row.goodSkuPic]">
                </el-image>
              </template>
            </el-table-column>
            <el-table-column prop="goodExpirationDate" width="180" label="有效期">
            </el-table-column>
            <el-table-column prop="goodWarrantyDate" width="180" label="保质期">
            </el-table-column>
            <el-table-column prop="goodOnlineLink" width="180" show-overflow-tooltip label="网上链接">
              <template slot-scope="scope">
                <div v-if="scope.row.goodOnlineLink">
                  <el-button type="text" @click="goNewPage(scope.row.goodOnlineLink)">跳转</el-button>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="goodBoxNum" width="180" label="箱规（数量）">
            </el-table-column>
            <el-table-column prop="goodBoxSize" width="180" label="箱规（尺寸mm）">
            </el-table-column>
            <el-table-column prop="goodOneSize" width="180" label="单个产品包装尺寸mm">
            </el-table-column>
            <el-table-column prop="shopFans" width="180" label="店铺粉丝量">
            </el-table-column>
            <el-table-column prop="goodSaleNum" width="180" label="产品销量">
            </el-table-column>
            <el-table-column prop="finalPrice" width="180" label="旗舰店实际成交价">
            </el-table-column>
            <el-table-column prop="realReadPrice" width="180" label="实际成交价">
            </el-table-column>
          </el-table>
        </div>
        <div v-show="active === 2" class="selectGoodsDataList">
          <div v-for="(good, index) in selectGoodsDataList" :key="index">
            <el-form :model="good" label-width="70px">
              <el-row :gutter="24">
                <el-col :span="8">
                  <el-form-item label="商品名称">
                    <span>
                      <el-tooltip effect="dark" :content="good.name" placement="top">
                        <span>{{formatterName(good.name)}}</span>
                      </el-tooltip>
                    </span>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="商品总数">
                    <span>{{good.splitTotal}}</span>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="拆单份数">
                    <el-input-number controls-position="right" v-model="good.splitNum" :precision="0" :min="2"
                      label="拆单份数" @change="val => splitOrderNumChange(val, good, index)"></el-input-number>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="24" class="splitOrderNumList">
                <div v-for="(item, indexId) in good.splitNumList" :key="indexId">
                  <el-col :span="8">
                    <el-form-item :label="'第' + (indexId + 1) + '份'">
                      <el-input-number controls-position="right" v-model="item.num" :precision="0" :min="0"
                        :label="'第' + (indexId + 1) + '份'">
                      </el-input-number>
                    </el-form-item>
                  </el-col>
                </div>
              </el-row>
            </el-form>
          </div>
        </div>
        <div v-show="active === 3" class="selectGoodsDataList">
          <el-form v-model="OrderValueObj" label-width="80px">
            <div v-for="(value, key, index) in OrderValueObj" :key="key">
              <div style="margin-bottom: 20px">第{{ index + 1 }}份订单</div>
              <el-row :gutter="24">
                <el-col :span="6">
                  <span>订单总货值：{{value.totalPrice}}</span>
                </el-col>
                <el-col :span="9">
                  <el-form-item label="订单走向">
                    <el-select v-model="value.useType" placeholder="请选择">
                      <el-option v-for="item in moreOptionsList" :key="item.id" :label="item.sysValueName"
                        :value="item.id">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="9">
                  <el-form-item label="预计变现" v-if="value.useType != 155">
                    <el-input-number v-model="value.expectPrice" :precision="2" :min="0" label="预计变现"></el-input-number>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </el-form>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="splitOrderDialog = false">取 消</el-button>
        <el-button type="primary" @click="returnSplit" v-if="active === 2 || active === 3">上一步</el-button>
        <el-button type="primary" @click="nextSplit" v-if="active === 1 || active === 2">下一步</el-button>
        <el-button type="primary" v-if="active === 3" @click="splitOrderConfirm">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 更多操作 -->
    <el-dialog :title="moreTitle" :visible.sync="moreOptionsDialog" width="30%" :close-on-click-modal="false"
      @close="moreOptionsDialogClose">
      <div>
        <el-form ref="moreOptionsRef" :model="moreOptionsForm" label-width="100px" :rules="moreOptionsRules">
          <el-form-item label="订单总货值">
            <span>{{ moreOptionsForm.totalPrice }}</span>
          </el-form-item>
          <el-form-item label="预计变现" prop="expectPrice">
            <el-input-number controls-position="right" v-model="moreOptionsForm.expectPrice" :precision="2" :min="0"
              label="预计变现">
            </el-input-number>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="moreOptionsDialog = false">取 消</el-button>
        <el-button type="primary" @click="moreOptionsConfirm">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="拆单" :visible.sync="splitOrderNewDialog" width="80%" :close-on-click-modal="false">
      <splitOrder :order-id="chooseOrderId" @closeDialog="closeSplitOrderNewDialog"
        @doRefushSplitOrder="doRefushSplitOrder"></splitOrder>
    </el-dialog>

    <!-- 父订单的成本和内部货值 -->
    <el-dialog title="分配子订单数据" :visible.sync="editCostSubOrderDialogVisible" width="30%" :close-on-click-modal="false"
      @close="editCostSubOrderDialogVisibleClose">
      <div>
        <el-form ref="editCostSubOrderFormRef" :model="editCostSubOrderForm" label-width="100px">
          <el-form-item label="内部货值" prop="innerPrice">
            <el-input-number controls-position="right" v-model="editCostSubOrderForm.innerPrice" :precision="2" :min="0"
              label="内部货值">
            </el-input-number>
          </el-form-item>
          <el-form-item label="预估成本" prop="estimatedCost">
            <el-form-item label="自营媒体成本" prop="estimatedSelfMediaCost">
              <el-input-number controls-position="right" v-model="editCostSubOrderForm.estimatedSelfMediaCost"
                :precision="2" :min="0" label="自营媒体成本">
              </el-input-number>
            </el-form-item>
            <el-form-item label="外采媒体成本" prop="estimatedExternalMediaCost">
              <el-input-number controls-position="right" v-model="editCostSubOrderForm.estimatedExternalMediaCost"
                :precision="2" :min="0" label="外采媒体成本">
              </el-input-number>
            </el-form-item>
          </el-form-item>
          <el-form-item label="实际成本" prop="actualCost">
            <el-form-item label="自营媒体成本" prop="actualSelfMediaCost">
              <el-input-number controls-position="right" v-model="editCostSubOrderForm.actualSelfMediaCost"
                :precision="2" :min="0" label="自营媒体成本">
              </el-input-number>
            </el-form-item>
            <el-form-item label="外采媒体成本" prop="actualExternalMediaCost">
              <el-input-number controls-position="right" v-model="editCostSubOrderForm.actualExternalMediaCost"
                :precision="2" :min="0" label="外采媒体成本">
              </el-input-number>
            </el-form-item>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="editCostSubOrderDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="editCostSubOrderDialogVisibleConfirm">确 定</el-button>
      </div>
    </el-dialog>


    <!-- 订单评级 -->
    <el-dialog title="订单评级" :visible.sync="setRateDialogVisible">
      <div style="display: flex;width: 100%;">
        <div style="align-items: center;display: flex;">评级：</div>
        <div style="width: 50%;">
          <el-select v-model="chooseRateId" placeholder="请选择评级">
            <el-option v-for="item in setRateList" :key="item.id" :label="item.sysValueName" :value="item.id">
            </el-option>
          </el-select>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="setRateDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="setRateDialogVisibleConfirm">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="跳过竞价-选择对应表单" :visible.sync="skipBiddingDialogVisible">
      <div style="display: flex;width: 100%;">
        <div style="width: 100%;">
          <el-table ref="otherHasBiddingOrderTable" :data="otherHasBiddingOrderList" highlight-current-row
            @current-change="handleCurrentChangeSkipToOrder" style="width: 100%">
            <el-table-column type="index" width="50">
            </el-table-column>
            <el-table-column property="totalPrice" label="客户货值">
            </el-table-column>
            <el-table-column property="createTime" label="创建时间">
              <template slot-scope="scope">
                {{ scope.row.createTime ? formatterTime(scope.row.createTime) : '-' }}
              </template>
            </el-table-column>
            <el-table-column property="orderKey" label="订单号">
            </el-table-column>
          </el-table>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="skipBiddingDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="skipBiddingDialogVisibleConfirm">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 修改商品信息弹窗 -->
    <el-dialog title="商品信息" :visible.sync="showUpdateGoodsDialogVisible" width="90%" :close-on-click-modal="false">
      <div style="display: flex;width: 100%;">
        <div style="width: 100%;">
          <div class="good_sku_list" v-if="
            showGoodList &&
              showGoodList.length > 0 &&
              orderShowMsg.fileType == 1 || orderShowMsg.fileType == 4
          ">
            <el-table :data="showGoodList" height="550" :row-style="{ height: '0' }" :cell-style="{ padding: '3px' }"
              style="width: 100%">
              <el-table-column prop="finalPrice" label="旗舰店实际成交价" fixed width="180">
                <template slot-scope="scope">
                  <el-input-number v-model="scope.row.finalPrice" :precision="2" :step="0.01"
                    size="small"></el-input-number>
                </template>
              </el-table-column>
              <el-table-column prop="" label="数据" fixed width="100">
                <template slot-scope="scope">
                  <el-popover placement="top" width="400" trigger="click">
                    <el-form label-position="right" label-width="100px" size="small">
                      <el-form-item label="旗舰店价格">
                        <el-input v-model="scope.row.flagshipStorePrice" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="旗舰店粉丝量">
                        <el-input v-model="scope.row.flagshipStoreFans" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="销量">
                        <el-input v-model="scope.row.salesNum" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="评价">
                        <el-input v-model="scope.row.evaluateContent" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="最低价">
                        <el-input v-model="scope.row.lowestPrice" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="链接">
                        <el-input v-model="scope.row.link" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                    </el-form>
                    <el-button slot="reference" type="text">修改</el-button>
                  </el-popover>
                </template>
              </el-table-column>
              <el-table-column prop="goodName" label="商品名称" fixed width="180" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodExpirationDate" width="180" label="有效期至" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodSku" label="规格" width="180" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodSkuPrice" width="180" label="旗舰店售卖价" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodOnlineLink" width="180" label="天猫/京东链接">
                <template slot-scope="scope">
                  <el-popover placement="left-start" title="" width="200" trigger="hover"
                    :content="scope.row.goodOnlineLink">
                    <el-button slot="reference" type="text" v-if="scope.row.goodOnlineLink">{{ scope.row.goodOnlineLink
                      }}</el-button>
                  </el-popover>
                  <!-- <el-link :href="scope.row.goodOnlineLink" type="primary" target="_blank"
                    v-if="scope.row.goodOnlineLink">跳转</el-link> -->
                </template>
              </el-table-column>
              <el-table-column prop="goodSkuPic" width="150" label="图片" show-overflow-tooltip>
                <template slot-scope="scope">
                  <el-image v-if="scope.row.goodSkuPic" style="width: 100px; height: 100px" :src="scope.row.goodSkuPic"
                    :preview-src-list="[scope.row.goodSkuPic]">
                  </el-image>
                </template>
              </el-table-column>

              <el-table-column prop="goodWarrantyDate" width="180" label="保质期" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodSkuNum" width="150" label="数量" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodCategory" width="180" label="商品所属类别（例:妆字号、械字号、消字号、药字号等）" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodBoxNum" width="180" label="箱规（数量）" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodBoxSize" width="180" label="箱规（尺寸mm）" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodOneSize" width="180" label="单个产品包装尺寸mm" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="shopFans" width="180" label="店铺粉丝量" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="goodSaleNum" width="180" label="产品销量" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="finalPrice" width="180" label="实际成交价">
              </el-table-column>
              <el-table-column prop="finalTotalPrice" width="180" label="实际成交总价">
              </el-table-column>
            </el-table>
          </div>
          <div class="good_sku_list" v-if="
              showGoodList &&
                showGoodList.length > 0 &&
                orderShowMsg.fileType == 2
    ">
            <el-table :data="showGoodList" max-height="750" :row-style="{ height: '0' }"
              :cell-style="{ padding: '3px' }" style="width: 100%">
              <el-table-column prop="chainStoreName" fixed label="连锁店铺名称">
              </el-table-column>
              <el-table-column prop="finalPrice" label="旗舰店实际成交价" fixed width="180">
                <template slot-scope="scope">
                  <el-input-number v-model="scope.row.finalPrice" :precision="2" :step="0.01"
                    size="small"></el-input-number>
                </template>
              </el-table-column>
              <el-table-column prop="" label="数据" fixed width="100">
                <template slot-scope="scope">
                  <el-popover placement="top" width="400" trigger="click">
                    <el-form label-position="right" label-width="100px" size="small">
                      <el-form-item label="旗舰店价格">
                        <el-input v-model="scope.row.flagshipStorePrice" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="旗舰店粉丝量">
                        <el-input v-model="scope.row.flagshipStoreFans" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="销量">
                        <el-input v-model="scope.row.salesNum" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="评价">
                        <el-input v-model="scope.row.evaluateContent" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="最低价">
                        <el-input v-model="scope.row.lowestPrice" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                      <el-form-item label="链接">
                        <el-input v-model="scope.row.link" placeholder="请输入" size="small"></el-input>
                      </el-form-item>
                    </el-form>
                    <el-button slot="reference" type="text">修改</el-button>
                  </el-popover>
                </template>
              </el-table-column>
              <el-table-column prop="category" fixed label="类别">
              </el-table-column>
              <el-table-column prop="storeNumber" label="店铺数量" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="links" label="美团/大众点评/小程序店铺链接">
                <template slot-scope="scope">
                  <el-popover placement="left-start" title="" width="200" trigger="hover" :content="scope.row.links">
                    <el-button slot="reference" type="text" v-if="scope.row.links">{{ scope.row.links }}</el-button>
                  </el-popover>
                  <!-- <div v-if="scope.row.links">
                    <el-button type="text" @click="goNewPage(scope.row.links)">跳转</el-button>
                  </div> -->
                </template>
              </el-table-column>
              <el-table-column prop="averageScore" label="美团/大众点评店铺平均评分" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="validityPeriod" label="有效期" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="useTime" label="使用时间" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="distributedCities" label="可使用分布城市" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="productName" label="产品名称" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="packageDetails" label="套餐详细内容" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="price" label="单价"></el-table-column>
              <el-table-column prop="num" label="数量"></el-table-column>
              <el-table-column prop="totalGoodPrice" label="合计货值" show-overflow-tooltip></el-table-column>
              <el-table-column prop="useRights" label="使用权益" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="couponForm" label="卡券形式（电子/实体）" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="usageRestrictions" label="使用限制" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="sellRequirements" label="客户对我司售卖要求" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="storeLinks" label="产品/套餐链接（美团、大众点评等）" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="storePics" label="产品/套餐图片" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="storeSaleNumbers" label="产品/套餐销量（美团、大众点评）" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="verificationProcess" label="核销流程" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="finalPrice" label="实际成交价">
              </el-table-column>
              <el-table-column prop="finalTotalPrice" width="180" label="实际成交总价">
              </el-table-column>
            </el-table>
          </div>
          <div class="good_sku_list" v-if="
              showGoodList &&
                showGoodList.length > 0 &&
    orderShowMsg.fileType == 3
    ">
            <div class="form_table_goods">
              <el-table :data="showGoodList" max-height="750" :row-style="{ height: '0' }"
                :cell-style="{ padding: '3px' }" style="width: 100%">
                <el-table-column prop="hotelName" fixed label="酒店名称">
                </el-table-column>
                <el-table-column prop="finalPrice" label="旗舰店实际成交价" fixed width="180">
                  <template slot-scope="scope">
                    <el-input-number v-model="scope.row.finalPrice" :precision="2" :step="0.01"
                      size="small"></el-input-number>
                  </template>
                </el-table-column>
                <el-table-column prop="" label="数据" fixed width="100">
                  <template slot-scope="scope">
                    <el-popover placement="top" width="400" trigger="click">
                      <el-form label-position="right" label-width="100px" size="small">
                        <el-form-item label="旗舰店价格">
                          <el-input v-model="scope.row.flagshipStorePrice" placeholder="请输入" size="small"></el-input>
                        </el-form-item>
                        <el-form-item label="旗舰店粉丝量">
                          <el-input v-model="scope.row.flagshipStoreFans" placeholder="请输入" size="small"></el-input>
                        </el-form-item>
                        <el-form-item label="销量">
                          <el-input v-model="scope.row.salesNum" placeholder="请输入" size="small"></el-input>
                        </el-form-item>
                        <el-form-item label="评价">
                          <el-input v-model="scope.row.evaluateContent" placeholder="请输入" size="small"></el-input>
                        </el-form-item>
                        <el-form-item label="最低价">
                          <el-input v-model="scope.row.lowestPrice" placeholder="请输入" size="small"></el-input>
                        </el-form-item>
                        <el-form-item label="链接">
                          <el-input v-model="scope.row.link" placeholder="请输入" size="small"></el-input>
                        </el-form-item>
                      </el-form>
                      <el-button slot="reference" type="text">修改</el-button>
                    </el-popover>
                  </template>
                </el-table-column>
                <el-table-column prop="hotelAddress" fixed label="酒店地址">
                </el-table-column>
                <el-table-column prop="busyTime" label="旺季时间">
                </el-table-column>
                <el-table-column prop="hotelType" label="房型"> </el-table-column>
                <el-table-column prop="expirationDate" label="有效期">
                </el-table-column>
                <el-table-column prop="isHaveMorning" label="是否含早"></el-table-column>
                <el-table-column prop="num" label="数量"></el-table-column>
                <el-table-column prop="price" label="平台价"> </el-table-column>
                <el-table-column prop="url" show-overflow-tooltip label="链接">
                </el-table-column>
                <el-table-column prop="hotelPic" label="房间图片">
                  <template slot-scope="scope">
                    <el-image v-if="scope.row.hotelPic" style="width: 100px; height: 100px" :src="scope.row.hotelPic"
                      :preview-src-list="[scope.row.hotelPic]">
                    </el-image>
                  </template>
                </el-table-column>
                <el-table-column prop="realPrice" width="180" label="实际成交价">
                </el-table-column>
                <el-table-column prop="finalTotalPrice" width="180" label="实际成交总价">
                </el-table-column>
              </el-table>
            </div>
          </div>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="showUpdateGoodsDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="showUpdateGoodsDialogVisibleConfirm">确 定</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import APIProject from "@/api/apiProject";
import APISysLabel from "@/api/apiSysLabel";
import APIOrder from "@/api/apiOrder";
import APIUser from "@/api/apiUser";
import splitOrder from "@/views/order/pages/splitOrder/SplitOrder";

export default {
  name: "Order",
  components: {
    splitOrder,
  },
  props: {
    operationList: Array,
    isShow: Boolean,
  },
  watch: {
    isShow(val) {
      if (val) {
        this.getPost();
      }
    },
  },
  data() {
    return {
      // 表格相关
      tableLoading: true,
      dataList: [],
      addTimeOutRemarkDialog:false,
      pageSize: 10,
      pageNum: 1,
      total: 0,
      pageSizes: [10, 15, 20],
      tokenData: {
        token: "",
      },
      btnStatus:false,
      searchForm: {
        keyword: null,
        cateIds: null,
        areaId: null,
        businessId: null,
        startPrice: null,
        endPrice: null,
        statusType: null,
        fileType:null,
        isTimeOut:null,
        orderGo:null,
        pushCheckTimeIndex: null,
        pushSureCheckStartTime: null,
        pushSureCheckEndTime: null,
        showSubOrderType: null,
      },
      dialogFormVisible: false,
      form: {
        projectId: null,
        projectName: "",
        brands: "",
        cateIdList: [],
        bussinessUsername: "",
        areaIds: [],
        permissionUsername: "",
      },
      formLabelWidth: "120px",
      dialogTitle: "新增",
      rules: {
        projectName: {
          required: true,
          message: "请输入客户公司名称",
          trigger: "blur",
        },
        timeOutContent: {
          min: 50,
          message: "最少50字",
          trigger: "blur",
        }
      },
      areaList: [],
      cateList: [],
      timeOutContent:"",
      bussinessUserList: [],
      permissionUserList: [],
      totalProjectId: null,
      projectShowMsg: null,
      chooseOrderId: null,
      pushUserList: [],
      pushAssitantList: [],

      pushUserDialogVisible: false,
      pushUserDialogTitle: "选择推送用户",
      rePushUserDialogVisible: false,
      rePushUserDialogTitle: "重新选择推送用户",
      pushMultipleSelection: [],
      pushAssitantSelection: [],
      orderShowMsg: {
        projectMsg: {},
      },
      orderMsgDialogVisible: false,
      orderGoodList: [],
      adjustOrderDialogVisible: false,
      adjustOrderType: 1,
      hasChooseGoodList: [],
      adjustOrderUserId: null,
      adjustUserList: [],
      blindPrice: 9,
      editCostDialogVisible: false,
      estimatedCost: 0,
      actualCost: 0,
      searchLoading: false,
      orderTypeList: [
        {
          label: "核价订单",
          value: 1,
        },
        {
          label: "本地生活",
          value: 2,
        },
        {
          label: "酒店民宿",
          value: 3,
        }
      ],
      statusList: [
        {
          label: "待推送",
          value: 1,
        },
        {
          label: "核价中",
          value: 2,
        },
        {
          label: "跟进中",
          value: 3,
        },
        {
          label: "已签单",
          value: 4,
        },
        {
          label: "执行完",
          value: 5,
        },
        {
          label: "已黄单",
          value: 9,
        },
        {
          label: "已流单",
          value: 11,
        },
      ],
      activeIndex: "10",
      statuses: null,
      resourcesRemark: null,
      resourcesRemarkDialogVisible: false,
      userInfo: {},
      splitOrderDialog: false,
      splitOrderNewDialog: false,
      splitOrderForm: {
        splitOrderNum: 2,
      },
      splitOrderNumList: [],
      splitOrderTotal: 2,
      active: 1,
      selectGoodsData: [],
      selectGoodsDataList: [],
      moreOptionsList: [],
      moreTitle: "",
      moreOptionsDialog: false,
      moreOptionsForm: {
        token: "",
        orderId: null,
        useType: null,
        totalPrice: null,
        expectPrice: 0.00,
      },
      moreOptionsRules: {
        expectPrice: [
          { required: true, message: "请输入预计变现", trigger: "blur" },
        ],
      },
      orderStr: {},
      OrderValueObj: {},
      OrderValueObjRules: {
        useType: [
          { required: true, message: "请选择订单去向", trigger: "change" },
        ],
        expectPrice: [
          { required: true, message: "请输入预计变现", trigger: "blur" },
        ],
      },
      pushCheckTimeList: [
        {
          label: "24小时以内",
          startTime: 0,
          endTime: (24 * 60 * 60),
        },
        {
          label: "24-48小时以内",
          startTime: 24 * 60 * 60,
          endTime: (48 * 60 * 60),
        },
        {
          label: "48-72小时以内",
          startTime: 48 * 60 * 60,
          endTime: (72 * 60 * 60),
        },
        {
          label: "72小时以上",
          startTime: 72 * 60 * 60,
          endTime: null,
        },
      ],
      editCostSubOrderDialogVisible: false,
      editCostSubOrderForm: {
        innerPrice: null,
        actualCost: null,
        estimatedSelfMediaCost: null,
        estimatedExternalMediaCost: null,
        actualSelfMediaCost: null,
        actualExternalMediaCost: null,
      },
      setRateDialogVisible: false,
      setRateList: [],
      chooseRateId: null,
      rateRecordList: [],
      otherHasBiddingOrderList: [],
      skipBiddingDialogVisible: false,
      chooseOtherHasBiddingOrder: null,
      showUpdateGoodsDialogVisible: false,
      showGoodList: [],
    };
  },
  watch: {
    '$route': function (to, from) {
      if (this.$route.query && this.$route.query.projectId) {
      } else {
        this.totalProjectId = null;
        this.projectShowMsg = null;
        this.getPost();
        this.getMoreOptionsList();
      }
    },
  },
  created() {
    if (this.$route.query && this.$route.query.projectId) {
      this.searchForm = {
        keyword: null,
        cateIds: null,
        areaId: null,
        businessId: null,
        startPrice: null,
        endPrice: null,
        statusType: null,
        fileType: null,
        isTimeOut:null,
        orderGo:null,
        pushCheckTimeIndex: null,
        pushSureCheckStartTime: null,
        pushSureCheckEndTime: null,
        showSubOrderType: null,
      };
    }
  },
  activated() {
    this.userInfo = JSON.parse(localStorage.getItem("mujinguserInfo"))
    this.totalProjectId = null;
    if (this.$route.query && this.$route.query.projectId) {
      this.totalProjectId = this.$route.query.projectId;
      this.getProjectMsg();
    } else {
      this.totalProjectId = null;
      this.projectShowMsg = null;
    }
    this.tokenData.token = this.$store.state.token;
    // this.statuses = '1,3,6'
    this.getPost();
    this.getMoreOptionsList();
  },
  mounted() {
    this.tokenData.token = this.$store.state.token;
    this.$bus.$on("clearSearchParams", () => {
      this.searchForm = {
        keyword: null,
        cateIds: null,
        areaId: null,
        businessId: null,
        startPrice: null,
        endPrice: null,
        statusType: null,
        isTimeOut:null,
        orderGo:null,
        pushCheckTimeIndex: null,
        pushSureCheckStartTime: null,
        pushSureCheckEndTime: null,
        showSubOrderType: null,
      };
    });
  },
  methods: {
    showUpdateGoodsDialogVisibleConfirm(){
      let list = this.showGoodList
      let submitList = []
      list.forEach(item => {
        let obj = {
          goodId: item.id,
          skuId: item.goodSkuId ? item.goodSkuId : null,
          num: item.goodSkuNum ? item.goodSkuNum : item.num ? item.num : 0,
          finalPrice: item.finalPrice,
          flagshipStorePrice: item.flagshipStorePrice,
          flagshipStoreFans: item.flagshipStoreFans,
          salesNum: item.salesNum,
          evaluateContent: item.evaluateContent,
          lowestPrice: item.lowestPrice,
          link: item.link
        }
        submitList.push(obj)
      })
      const params = {
        orderId: this.orderShowMsg.id,
        skuData: JSON.stringify(submitList)
      };
      APIOrder.submitFlagshipStoreData(params).then((res) => {
        if (res.key === 1000) {
          this.$message({
            message: "提交成功",
            type: "success",
          });
          this.getViewMsg({id: this.orderShowMsg.id})
          this.showUpdateGoodsDialogVisible = false
        }
      });
    },
    showUpdateGoodsDialog(){
      this.showUpdateGoodsDialogVisible = true
      this.showGoodList = this.orderShowMsg.goodList
    },
    viewGoods() {
      var orderId = this.orderShowMsg.id
      const params = {
        orderId: orderId,
      };
      APIOrder.viewGoodsList(params).then((res) => {
        if (res.key === 1000) {
          let list = res.result.list
          console.log("list", list)
        }
      });
    },
    showRecordList(id){
      const params = {
        token: this.$store.state.token,
        orderId: id,
      };
      APIOrder.getSetOrderRateRecordList(params).then((res) => {
        if (res.key === 1000) {
          this.rateRecordList = res.result.list
        }
      });
    },
    setRateDialogVisibleConfirm(){
      const params = {
        token: this.$store.state.token,
        orderId: this.chooseOrderId,
        rateId: this.chooseRateId
      };
      APIOrder.doSetOrderRate(params).then((res) => {
        if (res.key === 1000) {
          this.setRateDialogVisible = false
          this.getPost();
        }
      });
    },
    editCostSubOrderDialogVisibleConfirm(){
      const params = {
        token: this.$store.state.token,
        orderId: this.chooseOrderId,
      };
      if (this.editCostSubOrderForm.innerPrice){
        params.innerPrice = this.editCostSubOrderForm.innerPrice
      }
      if (this.editCostSubOrderForm.estimatedSelfMediaCost){
        params.estimatedSelfMediaCost = this.editCostSubOrderForm.estimatedSelfMediaCost
      }
      if (this.editCostSubOrderForm.estimatedExternalMediaCost){
        params.estimatedExternalMediaCost = this.editCostSubOrderForm.estimatedExternalMediaCost
      }
      if (this.editCostSubOrderForm.actualSelfMediaCost){
        params.actualSelfMediaCost = this.editCostSubOrderForm.actualSelfMediaCost
      }
      if (this.editCostSubOrderForm.actualExternalMediaCost) {
        params.actualExternalMediaCost = this.editCostSubOrderForm.actualExternalMediaCost
      }
      APIOrder.doEditOrderCost(params).then((res) => {
        if (res.key === 1000) {
          this.editCostSubOrderDialogVisible = false
          this.getPost();
        }
      });
    },
    editCostSubOrderDialogVisibleClose(){
      this.editCostSubOrderDialogVisible = false
    },
    doRefushSplitOrder(){
      this.splitOrderNewDialog = false;
      this.getPost();
    },
    closeSplitOrderNewDialog(){
      this.splitOrderNewDialog = false
    },
    handleSelectMenu(key, keyPath) {
      if (key) {
        if (key == 10) {
          this.statuses = null;
        } else if (key == 7) {
          this.statuses = "7";
        } else if (key == 9) {
          this.statuses = "9";
        } else if (key == 8) {
          this.statuses = "8";
        } else if (key == 1) {
          this.statuses = "1,3,6";
        } else if (key == 2) {
          this.statuses = "2,4,5";
        }
        this.getPost();
      }
    },
    getSysLabelListById(val) {
      const params = {
        token: this.$store.state.token,
        sysLabelIds: val,
      };
      APISysLabel.getSysLabelValueManageList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          if (res.data) {
            this.cateList = res.data[2];
            this.areaList = res.data[3];
            this.bussinessUserList = res.data[7];
            this.executionProgressList = res.data[12];
            this.arrivalProgressList = res.data[13];
            this.arrivalWarehouseList = res.data[14];
            this.searchLoading = false;
          }
        }
      });
    },
    visibleChangeBussiness(val) {
      if (val) {
        if (!this.bussinessUserList || this.bussinessUserList.length == 0) {
          this.searchLoading = true;
          this.getSysLabelListById(7);
        }
      }
    },
    visibleChangeArea(val) {
      if (val) {
        if (!this.areaList || this.areaList.length == 0) {
          this.searchLoading = true;
          this.getSysLabelListById(3);
        }
      }
    },
    visibleChangeCateIds(val) {
      if (val) {
        if (!this.cateList || this.cateList.length == 0) {
          this.searchLoading = true;
          this.getSysLabelListById(2);
        }
      }
    },
    goNewPage(val) {
      window.open(val, "_blank");
    },
    submitCostOrder() {
      const params = {
        orderId: this.chooseOrderId,
      };
      if (this.estimatedCost) {
        params.estimatedCost = this.estimatedCost;
      }
      if (!this.actualCost) {
        params.actualCost = this.actualCost;
      }
      APIOrder.doEditOrderCost(params).then((res) => {
        if (res.key === 1000) {
          this.$message({
            message: "修改成功",
            type: "success",
          });
          this.getPost();
          this.chooseOrderId = null;
          this.estimatedCost = null;
          this.actualCost = null;
          this.editCostDialogVisible = false;
        }
      });
    },
    handleSelectionChangeAdjustOrder(e) {
      this.hasChooseGoodList = e;
    },
    submitAdjustOrder() {
      if (!this.hasChooseGoodList || this.hasChooseGoodList.length <= 0) {
        this.$message({
          message: "请选择需要调整的商品",
          type: "error",
        });
        return;
      }
      const params = {
        orderId: this.chooseOrderId,
        goods: JSON.stringify(this.hasChooseGoodList),
      };
      if (this.adjustOrderUserId) {
        params.biddingUserId = this.adjustOrderUserId;
      }
      APIOrder.adjustOrder(params).then((res) => {
        if (res.key === 1000) {
          this.$message({
            message: "调整成功",
            type: "success",
          });
          this.getPost();
          this.chooseOrderId = null;
          this.adjustOrderUserId = null;
          this.adjustOrderDialogVisible = false;
        }
      });
    },
    goViewMsg(row){
      this.getViewMsg(row);
      this.orderMsgDialogVisible = true;
    },
    handleCommand(e, row) {
      if (e == "a") {
        this.getViewMsg(row);
        this.orderMsgDialogVisible = true;
      } else if (e == "b") {
        this.resourcesRemark = ""
        if(row.resourcesRemark){
          this.resourcesRemark = row.resourcesRemark
        }
        this.getPushUserList(row);
      } else if (e == "c") {
        this.getRePushUserList(row);
        this.$confirm("此操作将重新推送该订单, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            let list = [];
            this.pushUserList.forEach((item) => {
              list.push(item.id);
            });
            const params = {
              orderId: row.id,
              pushUserIds: list.join(","),
            };
            APIOrder.rePushOrderMsg(params).then((res) => {
              if (res.key === 1000) {
                this.rePushUserDialogVisible = false;
                this.getPost();
                this.$message({
                  type: "success",
                  message: "重新推送成功!",
                });
              }
            });
          })
          .catch((e) => {
            console.log(e);
            this.$message({
              type: "info",
              message: "已取消重新推送",
            });
          });
      } else if (e == "d") {
        this.$confirm("此操作将确认签单该订单, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.handleClickSure(row);
            this.$message({
              type: "success",
              message: "确认签单成功!",
            });
          })
          .catch((e) => {
            console.log(e);
            this.$message({
              type: "info",
              message: "已取消确认签单",
            });
          });
      } else if (e == "e") {
        if (row.isHasChild === 2) {
          this.$message({
            type: "warning",
            message: "不可作废，请先作废子订单",
          });
          return
        }
        this.$confirm("此操作将永久作废该订单, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.handleClickCancel(row);
            this.$message({
              type: "success",
              message: "作废成功!",
            });
          })
          .catch((e) => {
            console.log(e);
            this.$message({
              type: "info",
              message: "已取消作废",
            });
          });
      } else if (e == "f") {
        if (row.isHasChild === 2) {
          this.$message({
            type: "warning",
            message: "不可删除，请先删除子订单",
          });
          return
        }
        this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.handleClickDel(row);
            this.$message({
              type: "success",
              message: "删除成功!",
            });
          })
          .catch((e) => {
            console.log(e);
            this.$message({
              type: "info",
              message: "已取消删除",
            });
          });
      } else if (e == 'delChild') {
        this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
        .then(() => {
          this.deleteChildOrder(row)
        })
        .catch((e) => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
      } else if (e == "adjust") {
        if (row.isBlindBox && row.isBlindBox == 2) {
          this.adjustOrderType = 1;
          this.getNormalUserList();
        } else {
          this.adjustOrderType = 2;
        }
        this.chooseOrderId = row.id;
        this.viewAdjust(row);
      } else if (e == "editCost") {
        // this.chooseOrderId = row.id
        // this.editCostDialogVisible = true
        // this.estimatedCost = row.estimatedCost
        // this.actualCost = row.actualCost
        localStorage.setItem("editCostOrder", JSON.stringify(row));
        this.$router.push({
          path: "/EditCostOrder",
        });
      } else if (e == 'splitOrder') {
        this.chooseOrderId = row.id;
        this.active = 1;
        this.getViewMsg(row);
        this.splitOrderDialog = true;
      } else if (e == "changeResourcesRemark") {
        this.chooseOrderId = row.id;
        this.resourcesRemarkDialogVisible = true;
        this.resourcesRemark = row.resourcesRemark;
      } else if (e == "addTimeOutRemark") {
        this.chooseOrderId = row.id;
        this.addTimeOutRemarkDialog = true;
      } else if (e == 'splitOrderNew'){
        this.chooseOrderId = row.id;
        this.active = 1;
        this.splitOrderNewDialog = true;
      } else if (e == "editCostSubOrder"){
        this.chooseOrderId = row.id;
        this.editCostSubOrderDialogVisible = true;
      } else if (e == "setRate"){
        // 评级
        this.chooseOrderId = row.id;
        this.chooseRateId = null;
        this.getSysLabelListBySetRate();
        this.setRateDialogVisible = true;
      } else if (e == "skipBidding"){
        // 跳过竞价
        this.chooseOrderId = row.id;
        this.getOtherHasBiddingOrderList();
        this.skipBiddingDialogVisible = true;
      }
    },
    skipBiddingDialogVisibleConfirm(){
      console.log("--222----", this.chooseOtherHasBiddingOrder)
      if(!this.chooseOtherHasBiddingOrder || this.chooseOtherHasBiddingOrder.length == 0){
        this.$message({
          type: "warning",
          message: "请选择对应的订单",
        });
        return
      }
      const params = {
        token: this.$store.state.token,
        orderId: this.chooseOrderId,
        chooseOrderId: this.chooseOtherHasBiddingOrder.id
      };
      APIOrder.doSkipBidding(params).then((res) => {
        if (res.key === 1000) {
          this.$message({
            type: "success",
            message: "修改成功",
          });
          this.skipBiddingDialogVisible = false;
          this.getPost();
          this.chooseOrderId = null;
          this.chooseOtherHasBiddingOrder = null;
        }
      });
    },
    handleCurrentChangeSkipToOrder(val){
      this.chooseOtherHasBiddingOrder = val
    },
    getOtherHasBiddingOrderList() {
      const params = {
        token: this.$store.state.token,
        orderId: this.chooseOrderId,
      };
      APIOrder.getOtherHasBiddingOrderList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          this.otherHasBiddingOrderList = res.list
        }
      });
    },
    getSysLabelListBySetRate() {
      const params = {
        token: this.$store.state.token,
        sysLabelIds: "44",
      };
      APISysLabel.getSysLabelValueManageList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          if (res.data) {
            this.setRateList = res.data[44];
          }
        }
      });
    },
    viewAdjust(row) {
      const params = {
        orderId: row.id,
      };
      APIOrder.getOrderGoodList(params).then((res) => {
        if (res.key === 1000) {
          let list = res.result.list;
          list.forEach((item) => {
            item.maxNum = item.goodNum;
            item.price = item.goodPrice;
            if (this.adjustOrderType == 2) {
              item.goodPrice = this.blindPrice;
            }
          });
          this.orderGoodList = list;
          this.adjustOrderDialogVisible = true;
        }
      });
    },
    getNormalUserList() {
      const params = {
        userType: 1,
      };
      APIUser.getNormalUserList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          let list = res.list;
          this.adjustUserList = list;
        }
      });
    },
    getAssistantList(val) {
      const params = {
        assistantUserId: val,
      };
      APIUser.selectAssistantList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          let list = res.list;

          this.pushAssitantList = list;
          this.pushAssitantSelection = [];
        }
      });
    },
    getViewMsg(row) {
      this.chooseOrderId = row.id
      const params = {
        orderId: row.id,
      };
      APIOrder.getOrderMsg(params).then((res) => {
        if (res.key === 1000) {
          let data = res.result.data;
          if (data.projectMsg.createTime) {
            data.projectMsg.createDate = this.formatterTime(
              data.projectMsg.createTime
            );
          }
          if (data.biddingOneEndTime) {
            data.biddingOneEndDate = this.formatterTime(data.biddingOneEndTime);
          }
          if (data.createTime) {
            data.createDate = this.formatterTime(data.createTime);
          }
          if (data.checkCostPrice) {
            // 建议成本
            // 成本比例：开拓者建议的成本/客户货值
            data.checkCostPriceRate = (
              (data.checkCostPrice / data.totalPrice) *
              100
            ).toFixed(2);
          }
          if (data.checkCashPrice) {
            // 变现价格
            // 变现折扣：开拓者确认的价格/客户货值
            data.checkCashPriceRate = (
              (data.checkCashPrice / data.totalPrice) *
              100
            ).toFixed(2);
          }
          if (data.checkTime) {
            data.checkTime = this.formatterTime(data.checkTime);
          }
          // 计算实际成交总价
          data.goodList.forEach(item => {
            let num = item.num;
            if(item.goodSkuNum){
              num = item.goodSkuNum
            }
            let finalPrice = item.finalPrice;
            if(item.realPrice){
              finalPrice = item.realPrice
            }
            let itemFinalTotalPrice = parseFloat((finalPrice * num).toFixed(2));
            item.finalTotalPrice = itemFinalTotalPrice;
          })

          this.orderShowMsg = data;
          this.orderShowMsg.childOrderList = this.handleOrderList(this.orderShowMsg.childOrderList);
        }
      });
    },
    addTimeOutRemark(val){
      const params = {
        orderId: this.chooseOrderId,
      };
      if (this.timeOutContent.length < 50) return this.$message.error('最少50字') 
      if(this.timeOutContent){
        params.content = this.timeOutContent
      }
      APIOrder.doAddTimeOutRemark(params).then((res) => {
        if (res.key === 1000) {
          this.addTimeOutRemarkDialog = false;
          this.timeOutContent = "";
        }
      });

    },
    submitRePush() {
      if (
        !this.pushMultipleSelection ||
        this.pushMultipleSelection.length < 1
      ) {
        this.$message({
          message: "请至少选择选择一名开拓者",
          type: "error",
        });
        return;
      }
      if (this.pushMultipleSelection.length > 1) {
        this.$message({
          message: "请选择一名推送人员，不能多选",
          type: "error",
        });
        return;
      }
      let pushUserIdList = [];
      this.pushMultipleSelection.forEach((item) => {
        pushUserIdList.push(item.id);
      });
      this.pushAssitantSelection.forEach((item) => {
        pushUserIdList.push(item.id);
      });
      const params = {
        orderId: this.chooseOrderId,
        pushUserIds: pushUserIdList.join(","),
      };
      APIOrder.rePushOrderMsg(params).then((res) => {
        if (res.key === 1000) {
          this.rePushUserDialogVisible = false;
          this.getPost();
        }
      });
    },
    submitResourcesRemark() {
      const params = {
        orderId: this.chooseOrderId,
      };
      if (this.resourcesRemark) {
        params.resourcesRemark = this.resourcesRemark;
      }
      APIOrder.pushOrderResourcesRemark(params).then((res) => {
        if (res.key === 1000) {
          this.$message({
            message: "提交成功",
            type: "success",
          });
          this.resourcesRemarkDialogVisible = false;
          this.resourcesRemark = null;
          this.getPost();
        }
      });
    },
    submitPush() {
      if (
        !this.pushMultipleSelection ||
        this.pushMultipleSelection.length < 1
      ) {
        this.$message({
          message: "请选择推送人员",
          type: "error",
        });
        return;
      }
      if (this.pushMultipleSelection.length > 1) {
        this.$message({
          message: "请选择一名推送人员，不能多选",
          type: "error",
        });
        return;
      }
      let pushUserIdList = [];
      this.pushMultipleSelection.forEach((item) => {
        pushUserIdList.push(item.id);
      });
      this.pushAssitantSelection.forEach((item) => {
        pushUserIdList.push(item.id);
      });
      const params = {
        orderId: this.chooseOrderId,
        pushUserIds: pushUserIdList.join(","),
      };
      if (this.resourcesRemark) {
        params.resourcesRemark = this.resourcesRemark;
      }
      APIOrder.pushOrderMsg(params).then((res) => {
        if (res.key === 1000) {
          this.pushUserDialogVisible = false;
          this.resourcesRemark = null;
          this.getPost();
        }
      });
    },
    handleSelectionChangeAssistant(val) {
      this.pushAssitantSelection = val;
    },
    handleSelectionChange(val) {
      this.pushAssitantList = null;
      let that = this;
      if (val.length > 1) {
        this.$refs.pushTable.clearSelection();
        this.$refs.pushTable.toggleRowSelection(val.pop());
        return;
      }
      if (val.length == 1) {
        that.handleSelectionChangeTimeOut(val);
      }
    },

    handleSelectionChangeTimeOut(val) {
      this.pushMultipleSelection = val;
      let assistantUserId = this.pushMultipleSelection[0].id;
      this.getAssistantList(assistantUserId);
    },
    getRePushUserList(row) {
      this.chooseOrderId = row.id;
      const params = {
        userType: 2,
      };
      APIUser.getNormalUserList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          let list = res.list;
          list.forEach((item) => {
            if (item.createTime) {
              item.createDate = this.formatterTime(item.createTime);
            }
          });
          this.pushUserList = list;
          this.pushMultipleSelection = [];
          // this.rePushUserDialogVisible = true
        }
      });
    },
    getPushUserList(row) {
      this.chooseOrderId = row.id;
      const params = {
        userType: 2,
        isAssistant: 1,
      };
      APIUser.getNormalUserList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          let list = res.list;
          list.forEach((item) => {
            if (item.createTime) {
              item.createDate = this.formatterTime(item.createTime);
            }
          });
          this.pushUserList = list;
          this.pushMultipleSelection = [];
          // this.resourcesRemark = null;
          this.pushUserDialogVisible = true;
        }
      });
    },
    getProjectMsg() {
      this.tableLoading = true;
      const params = {
        token: this.$store.state.token,
        projectId: this.totalProjectId,
      };
      APIProject.getProjectManageMsg(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          let data = res.data;
          if (data.createTime) {
            data.createDate = this.formatterTime(data.createTime);
          }
          this.projectShowMsg = data;
          this.tableLoading = false;
        }
      });
    },
    handleClickCancel(row) {
      const params = {
        orderIds: row.id,
      };
      APIOrder.cancelOrder(params).then((res) => {
        if (res.key === 1000) {
          this.getPost();
        }
      });
    },
    handleClickSure(row) {
      const params = {
        orderIds: row.id,
      };
      APIOrder.sureCheckOrder(params).then((res) => {
        if (res.key === 1000) {
          this.getPost();
        }
      });
    },
    handleClickDel(row) {
      const params = {
        orderIds: row.id,
      };
      APIOrder.delOrder(params).then((res) => {
        if (res.key === 1000) {
          this.getPost();
        }
      });
    },
    getSysLabelList() {
      const params = {
        token: this.$store.state.token,
        sysLabelIds: "2,3,9",
      };
      APISysLabel.getSysLabelValueManageList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          if (res.data) {
            this.cateList = res.data[2];
            this.areaList = res.data[3];
            this.blindPrice = res.data[9][0].sysValueName;
          }
        }
      });
    },
    backShow() {
      this.$emit("backShow");
    },
    handleClick(item) {
      if (
        !this.cateList ||
        this.cateList.length == 0 ||
        !this.areaList ||
        this.areaList.length == 0 ||
        !this.blindPrice
      ) {
        this.getSysLabelList();
      }
      let a = JSON.parse(JSON.stringify(item));
      this.dialogTitle = "编辑";
      this.form = a;
      this.form.projectId = a.id;
      this.dialogFormVisible = true;
    },
    submit() {
      this.$refs["ruleForm"].validate((valid) => {
        if (valid) {
          const params = this.form;
          if (params.cateIdList && params.cateIdList.length > 0) {
            params.cateIds = params.cateIdList.join(",");
          }
          if (params.areaIds && params.areaIds.length > 0) {
            params.areaId = params.areaIds.join(",");
          }
          params.token = this.$store.state.token;
          if (this.form.projectId) {
            params.projectId = this.form.projectId;
            APIProject.editManageProject(params).then((res) => {
              if (res.key === 1000) {
                this.$message({
                  message: "修改成功",
                  type: "success",
                });
                this.getPost();
                this.dialogFormVisible = false;
              }
            });
          } else {
            APIProject.addManageProject(params).then((res) => {
              if (res.key === 1000) {
                this.$message({
                  message: "添加成功",
                  type: "success",
                });
                this.getPost();
                this.dialogFormVisible = false;
              }
            });
          }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    add() {
      if (
        !this.cateList ||
        this.cateList.length == 0 ||
        !this.areaList ||
        this.areaList.length == 0 ||
        !this.blindPrice
      ) {
        this.getSysLabelList();
      }
      this.$router.push({
        path: "/EditOrder",
      });
    },
    // searchTimeOut(){
    //   this.btnStatus = !this.btnStatus
    //   if(this.btnStatus == true){
    //     this.searchForm.isTimeOut = 2
    //   } else{
    //     this.searchForm.isTimeOut = null
    //   }
    //   this.getPost();
    // },
    formatterTime(time) {
      return time ? this.$moment(time).format("YYYY-MM-DD HH:mm:ss") : '--';
    },
    formatterTime2(t) {
      if (t){
        let v = t
        // 计算传入的值的时与分
        let minutes = Math.floor(v / 60);
        let hours = Math.floor(minutes / 60);
        const min = minutes % 60;
        let h = hours > 0 ? (hours + "小时") : ""
        let finalTime = h ? (h + min) : min
        return finalTime + "分钟"
      }else{
        return ""
      }
    },
    // 全局初始化
    init() {
      // 搜索条件重置
      this.searchForm = {
        keyword: null,
        cateIds: null,
        areaId: null,
        businessId: null,
        startPrice: null,
        endPrice: null,
        statusType: null,
        fileType:null,
        isTimeOut:null,
        orderGo:null,
        pushCheckTimeIndex: null,
        pushSureCheckStartTime: null,
        pushSureCheckEndTime: null,
        showSubOrderType: null,
      };
      this.rePosts();
    },
    // 分页pageSize改变
    handleSizeChange(e) {
      this.pageSize = e;
      this.rePosts();
    },
    // 分页pageNum改变
    handleCurrentChange(e) {
      this.pageNum = e;
      this.getPost();
    },
    // 重新请求
    rePosts() {
      this.pageNum = 1;
      this.dataList = [];
      this.getPost();
    },
    // 表格列表
    getPost() {
      this.tableLoading = true;
      const params = {
        token: this.$store.state.token,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
      };
      if (this.searchForm.showSubOrderType) {
        params.showSubOrderType = this.searchForm.showSubOrderType ? 1 : null;
      }
      if (this.searchForm.keyword) {
        params.keyword = this.searchForm.keyword;
      }
      if (this.totalProjectId) {
        params.projectId = this.totalProjectId;
      }
      if (this.searchForm.cateIds) {
        params.cateIds = this.searchForm.cateIds;
      }
      if (this.searchForm.areaId) {
        params.areaId = this.searchForm.areaId;
      }
      if (this.searchForm.businessId) {
        params.businessId = this.searchForm.businessId;
      }
      if (this.searchForm.startPrice) {
        params.startPrice = this.searchForm.startPrice;
      }
      if (this.searchForm.endPrice) {
        params.endPrice = this.searchForm.endPrice;
      }
      if (this.searchForm.statusType) {
        params.statusType = this.searchForm.statusType;
      }
      if (this.statuses) {
        params.statuses = this.statuses;
      }
      if (this.searchForm.fileType) {
        params.fileType = this.searchForm.fileType;
      }
      if (this.searchForm.isTimeOut) {
        params.isTimeOut = this.searchForm.isTimeOut;
      }
      if (this.searchForm.orderGo) {
        params.orderGo = this.searchForm.orderGo;
      }
      if (this.searchForm.pushCheckTimeIndex || this.searchForm.pushCheckTimeIndex == 0){
        let pushCheckTimeMsg = this.pushCheckTimeList[this.searchForm.pushCheckTimeIndex]
        if(pushCheckTimeMsg){
          params.pushSureCheckStartTime = pushCheckTimeMsg.startTime
          if(pushCheckTimeMsg.endTime){
            params.pushSureCheckEndTime = pushCheckTimeMsg.endTime
          }
        }
      }
      if (this.searchForm.pushSureCheckStartTime){
        params.pushSureCheckStartTime = this.searchForm.pushSureCheckStartTime * 60 * 60
      }
      if (this.searchForm.pushSureCheckEndTime){
        params.pushSureCheckEndTime = this.searchForm.pushSureCheckEndTime * 60 * 60
      }
      APIOrder.orderList(params).then((res) => {
        if (res.key === 1000) {
          res = res.result;
          this.total = res.count;
          this.dataList = this.handleOrderList(res.list);
          this.tableLoading = false;
        }
      });
    },
    handleOrderList(list) {
      if(list && list.length > 0){
        list.forEach((item) => {
          item.showProjectMore = false;
          if (item.childOrderList && item.childOrderList.length > 0) {
            item.childOrderList.forEach((child) => {
              child.showProjectMore = false;
            });
          }
        });
      }
      return list;
    },
    splitOrderDialogClose() {
      this.$refs.splitOrderFormRef.resetFields();
      this.splitOrderNumList = [];
      this.splitOrderDialog = false;
    },
    // 选择商品
    handleSelectGoods(val) {
      this.selectGoodsData = val;
      console.log(this.selectGoodsData)
    },
    // 上一步
    returnSplit() {
      this.active--;
    },
    // 下一步
    nextSplit() {
      if (this.selectGoodsData.length === 0) {
        this.$message.warning('请选择商品');
        return;
      }
      if (this.active === 1) {
        this.selectGoodsDataList = this.selectGoodsData.map(item => {
          return {
            name: item.goodName,
            splitNum: 2,
            splitTotal: item.goodNum,
            goodId: item.id,
            skuId: item.goodSkuId,
            goodSkuPrice: item.goodSkuPrice,
            splitNumList: this.handlesplitOrderNumData(item.goodNum, 2, item.id, item.goodSkuId)
          }
        })
      }
      if (this.active === 2) {
        let flagParams = this.getSplitOrderStatus()
        if (flagParams.flag) {
          this.orderStr = this.handleOrderStr(this.selectGoodsDataList)
          this.OrderValueObj = this.handleOrderValue(this.orderStr)
        } else {
          this.$message.warning('分单数量不正确，请检查第' + (flagParams.flagIndex + 1) + '个商品');
          return;
        }
      }
      this.active++;
    },
    // 判断分单数量是否正确
    getSplitOrderStatus() {
      let flag = true
      let flagIndex = 0
      // 判断selectGoodsDataList中每一个splitNumList中的num相加等不等于外层splitTotal的值
      for (let i = 0; i < this.selectGoodsDataList.length; i++) {
        let total = 0
        for (let j = 0; j < this.selectGoodsDataList[i].splitNumList.length; j++) {
          total += this.selectGoodsDataList[i].splitNumList[j].num
        }
        if (total !== this.selectGoodsDataList[i].splitTotal) {
          flag = false
          flagIndex = i
          break
        }
      }
      return {flag, flagIndex}
    },
    // 确认分单
    splitOrderConfirm() {
      let params = {
        fileType: 1,
        parentId: this.chooseOrderId,
        orderStr: JSON.stringify(this.orderStr),
        useTypeStr: JSON.stringify(this.OrderValueObj),
      }
      // return console.log(params)
      APIOrder.doSplitOrder(params).then(res => {
        if (res.key === 1000) {
          this.$message.success('分单成功');
          this.splitOrderDialog = false;
          this.getPost();
        }
      })
    },
    // 订单拆单
    handleOrderStr(list) {
      let obj = {}
      for (let i = 0; i < list.length; i++) {
        let item = list[i];
        for (let j = 0; j < item.splitNumList.length; j++) {
          let key = 'key' + j;
          if (!obj[key]) {
            obj[key] = [];
          }
          obj[key].push(item.splitNumList[j]);
        }
      }
      return obj;
    },
    // 订单走向
    handleOrderValue(obj) {
      let result = {}
      for (let key in obj) {
        let totalPrice = 0
        for (let i = 0; i < obj[key].length; i++) {
          for (let j = 0; j < this.selectGoodsDataList.length; j++) {
            if (this.selectGoodsDataList[j].goodId === obj[key][i].goodId) {
              result[key] = {
                totalPrice: totalPrice += this.selectGoodsDataList[j].goodSkuPrice * obj[key][i].num,
                useType: '',
                expectPrice: ''
              };
            }
          }
        }
      }
      return result
    },
    splitOrderNumChange(val, good, index) {
      this.selectGoodsDataList[index].splitNumList = this.handlesplitOrderNumData(good.splitTotal, val, good.goodId, good.skuId);
    },
    handlesplitOrderNumData(total, num, goodId, skuId) {
      let quotient = Math.floor(Number(total) / Number(num));
      let remainder = total % num;
      let arr = Array.from({length: num}, () => ({ num: quotient, goodId: goodId, skuId: skuId}));
      for (let i = 0; i < remainder; i++) {
        arr[i].num += 1;
      }
      return arr;
    },
    formatterName(name) {
      return name.length > 20 ? name.slice(0, 20) + '...' : name;
    },
    // 展开操作列
    showOptions(val) {
      if (val) {
        this.getMoreOptionsList();
      }
    },
    // 获取更多操作
    getMoreOptionsList() {
      const params = {
        token: this.$store.state.token,
        sysLabelIds: 42,
      };
      APISysLabel.getSysLabelValueManageList(params).then((res) => {
        if (res.key === 1000) {
          this.moreOptionsList = res.result.data[42]
        }
      });
    },
    // 更多操作
    moreOptionsChange(val, row) {
      if (val === 155) {
        this.handleCommand('b', row)
      } else {
        this.moreTitle = this.moreOptionsList.find(item => item.id === val).sysValueName
        this.moreOptionsDialog = true
        this.moreOptionsForm = {
          orderId: row.id,
          totalPrice: row.totalPrice,
          useType: val,
        }
      }
    },
    // 初始化更多操作表单
    moreOptionsDialogClose() {
      this.$refs['moreOptionsRef'].resetFields()
    },
    // 更多操作提交
    moreOptionsConfirm() {
      this.$refs['moreOptionsRef'].validate((valid) => {
        if (valid) {
          APIOrder.confirmOrderUse(this.moreOptionsForm).then(res => {
            if (res.key === 1000) {
              this.$message.success('操作成功')
              this.moreOptionsDialog = false
              this.getPost()
            }
          })
        }
      })
    },
    // 删除子订单
    deleteChildOrder(row) {
      let params = {
        parentId: row.id,
        token: this.$store.state.token
      }
      APIOrder.deleteChild(params).then(res => {
        if (res.key === 1000) {
          this.$message.success('删除成功')
          this.getPost()
        }
      })
    },
    handleShowStatus(row) {
      this.orderShowMsg.childOrderList.find(item => item.id === row.id).showProjectMore = !row.showProjectMore
      this.$forceUpdate()
    },
    formatterOrderType(type) {
      let item = this.moreOptionsList.find(item => item.id === type)
      return item ? item.sysValueName : ''
    }
  },
};
</script>

<style lang="sass">
.avatar-uploader
    .el-upload
      border: 1px dashed #d9d9d9
      border-radius: 6px
      cursor: pointer
      position: relative
      overflow: hidden
      &:hover
        border-color: #409eff
      .avatar-uploader-icon
        font-size: 28px
        color: #8c939d
        width: 100px
        height: 100px
        line-height: 100px !important
        text-align: center
      .avatar
        width: 100px
        height: 100px
        display: block
</style>
<style lang="sass" scoped>
.adjustOrderItem
    margin: 20px auto
    display: flex
    width: 100%
    .adjustOrderItem_left
        width: 100px
    .adjustOrderItem_right
        width: 100%

.project_msg
    width: 100%
    background-color: #FFFFFF
    margin: 20px auto
.project_msg_show
    width: 90%
    margin: 0 auto
    padding: 20px 0
.global-operation-list
  padding-left: 0
.global-select .global-select-btn
  background: #FFFFFF
.global-table-content
  padding: 0
  background-color: white
  width: 100%
.global-table-content-a
  margin: 0 auto
  width: 90%
  padding: 20px 0
.company-user-list
  //@include container
  .isStatus1
    width: 41px
    height: 21px
    background: #F1FFFC
    border-radius: 3px
    border: 1px solid #03C192
    font-size: 14px!important
    color: #03C192!important
    line-height: 21px
    text-align: center
  .isStatus2
    width: 41px
    height: 21px
    background: #FFF2F2
    border-radius: 3px
    border: 1px solid #F46565
    font-size: 14px!important
    color: #F44141!important
    line-height: 21px
    text-align: center
  .global-operation-left
    margin-right: 0
  ::v-deep .permission-dialog
    .el-dialog__body
      display: flex
      align-items: center
      flex-direction: column
      padding: 30px 60px
      .permission-dialog-tree
        width: 100%
        max-height: 450px
        overflow-y: auto
        overflow-x: hidden
        margin-bottom: 40px
  .global-table
    display: flex
    align-items: center
    justify-content: center
    flex-direction: column
    .list
      background: #FFFFFF
      box-shadow: 0px 0px 10px 0px rgba(93, 139, 198, 0.05)
      border-radius: 14px
      margin-bottom: 15px
      width: 100%
      display: flex
      align-items: center
      justify-content: space-between
      padding: 19px 24px
      .left
        display: flex
        align-items: center
        .img
          width: 90px
          height: 90px
          border-radius: 4px
          margin-right: 17px
        .nav
          .text1
            font-size: 20px
            font-weight: bold
            color: #222222
            line-height: 26px
            display: flex
            align-items: center
            justify-content: flex-start
            margin-bottom: 16px
            span
              height: 16px
              background: #FFF8ED
              border-radius: 11px
              border: 1px solid #FF9901
              font-size: 12px
              color: #FF9901
              line-height: 16px
              padding: 0 8px
              display: block
              text-align: center
              margin-left: 11px
          .text2
            display: flex
            align-items: center
            justify-content: flex-start
            margin-bottom: 25px
            i
              font-size: 20px
              color: #1861FD
              margin-right: 7px
            .text2_1
              font-size: 14px
              color: #222222
              line-height: 19px
              margin-right: 7px
            .text2_2
              margin-left: 5px
              font-size: 23px
              font-weight: bold
              color: #222222
              line-height: 29px
              margin-right: 3px
            .text2_3
              font-size: 14px
              color: #B5B5C3
              line-height: 19px
          .text3
            display: flex
            align-items: center
            i
              font-size: 14px
              color: #B5B5C3
              margin-right: 5px
            div
              font-size: 14px
              color: #B5B5C3
              line-height: 19px
              margin-right: 80px
      .right
//.permission-dialog-item
//  background: #f2f2f2
.selectGoodsDataList
  height: 49vh
  overflow-y: auto
  overflow-x: hidden
.splitOrderNumList
  max-height: 20vh
  overflow-y: auto
</style>
